0% found this document useful (0 votes)
30 views12 pages

WT CAT 2 Preaparation Material

The document discusses various topics related to web development including: 1. It provides sample code for an XML document containing book information with elements for title, author, ISBN, publisher, edition and price. 2. It defines a DTD to validate the XML document structure. 3. It mentions using DOM to parse the XML strings. The document provides an example of creating an XML file to store book information, defining a DTD to validate the XML structure, and parsing the XML using DOM.

Uploaded by

varsheni
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views12 pages

WT CAT 2 Preaparation Material

The document discusses various topics related to web development including: 1. It provides sample code for an XML document containing book information with elements for title, author, ISBN, publisher, edition and price. 2. It defines a DTD to validate the XML document structure. 3. It mentions using DOM to parse the XML strings. The document provides an example of creating an XML file to store book information, defining a DTD to validate the XML structure, and parsing the XML using DOM.

Uploaded by

varsheni
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

PART A

1. When using the POST method, variables are displayed in the URL:
a)True b)False
2. Which super global variable holds information about headers, paths, and script locations?
a)$GLOBALS b)$_GET c)$_SESSION d)$_SERVER
3. What is the correct syntax of the declaration which defines the XML version?
a)<?xml version="1.0" /> b)<xml version="1.0" /> c)<?xml
version="1.0"?>
d) <?xml version="1.0"->
4. Is this a "well formed" XML document?
<?xml version="1.0"?>
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body> Hello Hi!</body>
</note>
a)No b)Yes
5. Examine the statement which is NOT true?
a)White-space is not preserved in XML b)XML elements must be properly nested
c)XML documents must have a root tag d)XML tags are case sensitive
6. Which of the following statement is true for AngularJS?
a) AngularJS is a closed-source front-end web framework b) AngularJS is an open-source front-
end web framework c) AngularJS is an open-source backend web framework d) AngularJS is
a closed-source back-end web framework
7. Identify the correct statement about data binding in AngularJS?
a) Automatic synchronization of data between model and view components
b) Automatic synchronization of data between model and controller components
c) Technique to save html data in the database d) Technique to bind database data to html
control
8. Choose the right directive which is used to bind the application data to the HTML view in
AngularJS?
a)ng-app directive b)ng-model directive c)ng-bind directive d)ng-init directive
9. Node js is written in
a)JavaScript b)C c) C++ d)All of the above
10. Django is a _____________ Python web framework.
a) low-level b) mid-level c) high-level d) None of the above
11. How do you create an array in PHP?
a)$cars = array("Volvo", "BMW", "Toyota"); b)$cars = array["Volvo", "BMW",
"Toyota"];
c)$cars = "Volvo", "BMW", "Toyota"; d)$cars = Volvo , BMW, Toyota;
12. Is this a "well formed" XML document?
<?xml version="1.0"?>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body> Hello Hi!</body>
a)Yes b)No
13. What does XSL stand for?
a)eXtensible Stylesheet Language b)eXtra Style Language c)eXtensible Style Listing
d)eXpandable Style Language
14. For the XML parser to ignore a certain section of your XML document, which syntax is
correct?
a)<![CDATA[ Text to be ignored ]]> b)<xml:CDATA[ Text to be ignored ]>
c)<CDATA> Text to be ignored </CDATA> d)<PCDATA> Text to be ignored
</PCDATA>
15.What is a correct way of referring to a stylesheet called "mystyle.xsl" ?
a)<?xml-stylesheet type="text/xsl" href="mystyle.xsl" ?>
b)<stylesheet type="text/xsl" href="mystyle.xsl" />
c)<link type="text/xsl" href="mystyle.xsl" />
d)<link type="text/xsl" href="mystyle.xsls" />
16.Which of the following is the correct syntax for writing AngularJS expressions?
a) {{expression}} b) {{expression | filter1 | filter2 | …}} c) Both of the mentioned
d) None of the mentioned
17.What is a Model in MVC?
a) the lowest level of the pattern responsible for maintaining data
b) represents server-side data c) represents data stored in a database d) None of the
mentioned
18.Which of the following is used to share data between controller and view in AngularJS?
a)using Model b)using services c)using factory d)using $scope
19.What does the REPL stand for?
a)REPL stands for "Read Eval Print Loop." b)REPL stands for "Research Eval Program Learn."
c)REPL stands for "Read Earn Point Learn." d)REPL stands for "Read Eval Point Loop."
20.What is the base principle of MVT in Django?
a)Model, Template, View b)Model, View, Template c)Template, Model, View
d)Template, View, Model
PART B
1. What is session tracking? list the methods to store the session.
A session is a conversation between the server and a client. A conversation consists series
of continuous request and response. Session Tracking is a way to maintain state (data) of
an user. It is also known as session management in servlet.
Session tracking methods:
User authorization
Hidden fields
URL rewriting
Cookies
Session tracking API
2. List the different data types in PHP?
Data Types define the type of data a variable can store. PHP allows eight different types of
data types. All of them are discussed below. There are pre-defined, user-defined, and
special data types.
The predefined data types are:
Boolean Integer Double String
The user-defined (compound) data types are:
Array Objects
The special data types are:
NULL resource
3. Differentiate DTD and XSD.

4. How to import external library to nodejs?


Steps to use an external library in Java:

1. Download the library as a jar file from the developer website.


2. Place the jar file into the same folder as the source code.
3. Inside your Java program, use the import statement to import the required
package/class inside the jar file.

5. Can you describe the difference between user interface (UI) design and UX design?
User interface (UI) design refers to the aesthetic elements by which people interact with a
product, such as buttons, icons, menu bars, typography, colors, and more. User experience
(UX) design refers to the experience a user has when interacting with a product.
The key differentiator between UI and UX is what they focus on, and how the user interacts
with them. UI focuses on visual interface elements such as typography, colors, menu bars,
and more, while UX focuses on the user and their journey through the product.
6. Show the steps to store cookies in Javascript.
Following are the steps to store a cookie:
Step 1: document.cookie object, make a string value for assigning it to the respective
object.
Step 2: Example: document.cookie = “Attempt1 = input1;Attempt2 = input2; expires =
date”;
Mentioning the data field is optional. If a particular time or data is specified in the
respective field, the cookie will be deleted on the mentioned time or data. The cookie, after
getting deleted, will not be available for any further use.
It is important to know that character values such as semicolons, or commas, or any
whitespace cannot be included while defining the value of a cookie.
7. State the purpose of DTD and give an example.
The purpose of a DTD is to define the legal building blocks of an XML document. It defines
the document structure with a list of legal elements. A DTD can be declared inline in your
XML document, or as an external reference.
Example:
<?xml version="1.0"?>
<!DOCTYPE note [
<!ELEMENT note (to,from,heading,body)>
<!ELEMENT to (#PCDATA)>
<!ELEMENT from (#PCDATA)>
<!ELEMENT heading (#PCDATA)>
<!ELEMENT body (#PCDATA)>
]>

<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend</body>
</note>
8. Indicate the use XML Namespace?
An XML namespace is a collection of names that can be used as element or attribute names
in an XML document. The namespace qualifies element names uniquely on the Web in
order to avoid conflicts between elements with the same name
9. What is Docker Container? Give example for creating a Docker container.
A container is a standard unit of software that packages up code and all its dependencies
so the application runs quickly and reliably from one computing environment to another.
A Docker container image is a lightweight, standalone, executable package of software that
includes everything needed to run an application: code, runtime, system tools, system
libraries and settings.
10. How will you maintain the sessions in MVC?
The sessions of an MVC can be maintained in 3 possible ways:
View data
Temp data and
View bag
PART C
1. Create an XML file which will display the book information which include the following:
1.Title of the book
2.Author name
3.Publisher name
4.Edition
5.Price
Write a Document Type Definition (DTD) to validate the above XML file and Use DOM
to parse the strings.
Answer:
Write a Document Type Definition (DTD) to validate the XML file.

PROGRAM:

XML document (bookstore.xml)

<bookstore>
<book>
<title>web programming</title>
<author>chrisbates</author>
<ISBN>123-456-789</ISBN>
<publisher>wiley</publisher>
<edition>3</edition>
<price>350</price>
</book>
<book>
<title>internet worldwideweb</title>
<author>ditel&amp;ditel</author>
<ISBN>123-456-781</ISBN>
<publisher>person</publisher>
<edition>3</edition>
<price>450</price>
</book>
</bookstore>

XML document Validation using DTD

DTD document (bookstore.dtd)

<?xml version="1.0" encoding="UTF-8"?>


<!ELEMENT bookstore (book+)>
<!ELEMENT book (title,author,ISBN,publisher,edition,price)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT author (#PCDATA)>
<!ELEMENT ISBN (#PCDATA)>
<!ELEMENT publisher (#PCDATA)>
<!ELEMENT edition (#PCDATA)>
<!ELEMENT price (#PCDATA)>
The XML Tree Structure

2. Write down the steps in establishing a JDBC Connection. Give examples.


JDBC driver is used for interacting with the database server which implements the stated
interfaces in the JDBC API. For example, JDBC drivers interact with the database to open
database connections by sending SQL or database commands and receive the results with
Java:
Types of JDBC Drivers
There are four different types of JDBC drivers:
1. Type 1: JDBC - ODBC bridge driver
2. Type 2: Java - Native code driver
3. Type 3: Network - Protocol driver (Middleware driver)
4. Type 4: Database - Protocol driver (Pure Java driver)
(i) JDBC – ODBC Bridge
ODBC driver is a type 1 driver installed on every client machine. It can be accessible by
the
JDBC Bridge which supports ODBC accessibility but at present this type is recommended
only
for experimental purposes.
In a Type 1 driver (JDBC – ODBC Bridge), a JDBC bridge is used to access ODBC drivers
installed on each client machine. Using ODBC requires configuring your system a Data
Source Name (DSN) that represents the mark database. When Java first came out, JDBC –
ODBC Bridge was a valuable driver because most databases only supported ODBC access
but now this type of driver is approved only for experimental use or when no another
alternative is available. The JDBC-ODBC Bridge that comes with JDBC version JDK 1.2
is a good example of this kind of driver.
(ii) Native – API Driver
JDBC Native API is unique to the database because these API calls are converted into
native C/C++ API calls. They are provided by the database vendors and used in a similar
manner as the JDBC-ODBC Bridge. The vendor-specific driver must be installed on each
client machine and if the programmer wants to change the database, then the programmer
has to modify the native API too. JDBC-Native API can perform faster when compared to
Type 1 driver because it eliminates ODBC’s Overhead.
The Oracle Call Interface (OCI) driver is an example of a Type 2 driver.
(iii) Network – Protocol Driver (Middleware Driver) Network-Protocol driver is also called
as middleware driver. It has a three-tier approach to access databases. It communicates
with the middleware application server through a standard network socket. Then the device
information is translated by the middleware application server as a call format required by
the DBMS and forwarded to the database server. Middleware drivers are extremely flexible
since no code is installed on the client side. Even a single driver can provide access to
multiple databases.
You can analyse the application server as a JDBC "proxy," meaning that it creates calls to
the client application. As a result, you need some information about the application server's
configuration to effectively use this driver type. Your application server might use a Type
1, 2, or 4 drivers to communicate with the database, understanding the nuances will prove
helpful.
(iv) Database – Protocol Driver (Pure Java Driver)
Database- Protocol driver is a type 4 driver called as a pure Java driver. It communicates
directly with the vendor’s database through socket information. It acts as the highest
performance driver available for the database which is provided by the supplier itself.
Pure Java driver does not require any special software to install on the client or server side
rather these drivers can be downloaded dynamically.

This driver named as MySQL's Connector/J driver is a Type 4 driver. Because of the proprietary
nature of their network protocols, database vendors supply type 4 drivers.
3. Develop a PHP program:
a) To print each element of an array (5)
b) To Find The Product of Elements In An Array (5)
4. Briefly discuss about MVC architecture and its advantages.

5. Describe in detail the session handling in server side programming


6. Create a PHP code to develop a calculator application.
7. Explain how XSLT transforms the document from one (Word) type to other type (HTML).
8. Write short notes on:
i) UI/UX.
ii) Firebase and Dockers.

You might also like