IT 2353 Unit IV 2marks
IT 2353 Unit IV 2marks
IT 2353 Unit IV 2marks
PART – A
1.What is XSLT?
XSLT stands for XSL Transformations and is a language used to transform XML
documents into XHTML documents or to other XML documents.
XPATH is used to scan the XML document for navigation of elements and
attributes. It contains a library of standard functions string ad numeric values. For
navigation, XPATH makes use of path expressions to select nodes or sets of nodes in a
XML document.
XSLT shares the same data model of XPATH with some additions. XSLT
accepts a XSLT stylesheet as an input and output is another XML, text or another
document. The model is based on text nodes. These text nodes are embedded within
element nodes. The model is a hierarchical structure like a tree. The tree has a variety of
nodes like- text nodes, attribute nodes, element nodes, comment nodes, and processing
instruction nodes. For every node type there is a way of determining a string-value for a
node of that type.
XML HTML
8.Describe the role that XSL can play when dynamically generating HTML pages
from a relational database?
9.Give a few examples of types of applications that can benefit from using XML.
There are literally thousands of applications that can benefit from XML
technologies. The point of this question is not to have the candidate rattle off a laundry
list of projects that they have worked on, but, rather, to allow the candidate to explain the
rationale for choosing XML by citing a few real world examples. For instance, one
appropriate answer is that XML allows content management systems to store documents
independently of their format, which thereby reduces data redundancy. Another answer
relates to B2B exchanges or supply chain management systems. In these instances, XML
provides a mechanism for multiple companies to exchange data according to an agreed
upon set of rules. A third common response involves wireless applications that require
WML to render data on hand held devices.
11.Give some examples of XML DTDs or schemas that you have worked with.
Although XML does not require data to be validated against a DTD, many
of the benefits of using the technology are derived from being able to validate XML
documents against business or technical architecture rules. Polling for the list of DTDs
that developers have worked with provides insight to their general exposure to the
technology. The ideal candidate will have knowledge of several of the commonly used
DTDs such as FpML, DocBook, HRML, and RDF, as well as experience designing a
custom DTD for a particular project where no standard existed.
12.Using XSLT, how would you extract a specific attribute from an element in an
XML document?
<xsl:template match="element-name">
Attribute Value:
<xsl:value-of select="@attribute"/>
<xsl:apply-templates/>
</xsl:template>
13.Why we used JSP?
JSP allow developer to quickly produce web sites and applications in an open
and standard way and it is easy to learn. JSP is Java based an object-oriented language
and offers a robust platform for web development
HTML and graphics displayed on the web browser are the presentation layer
and the Java code (JSP) on the server is classed as the implementation.
A DTD is a set of rules that specifies how to use XML markup. It contains
specifications for each element, including what the element\'s attributes are, what values
the attributes can take on and what elements can be contained in others.
19. What are the XML rules for distinguishing between the content of a document
and the XML markup element?
• The start of XML markup elements is identified by either the less than symbol (<)
orthe ampersand (&) character
• Three other characters, the greater than symbol (>), the apostrophe or single quote
(‘)and the double quotation marks (“) are used by XML for markup.
• To use these special characters as content within your document, you must use the
corresponding general XML entity.
• Stylesheet
• Value-of
• For-each
• Sort
• Text
21.What is VoiceXML?
Literally data about data. XML element and attribute names are considered
metadata in that they may be used to describe the data contained in a document. Metadata
isn’t needed but it certainly helps.
33. Write down the various attributes for the page directives in JSP?
• The page directive defines information that will be globally available for that Java
Server Page,
• Language
• Extends
• Import
• Session
• Buffer
• contenttype
A comments that documents the JSP page but is not sent to the client. The
JSP engine ignores a hidden comment, and does not process any code within hidden
comment tags. A hidden comment is not sent to the client, either in the displayed JSP
page or the HTML page source. The hidden comment is useful when you want to hide
or \"comment out\" part of your JSP page.
You can use any characters in the body of the comment except the closing
--%> combination. If you need to use --%> in your comment, you can escape it by typing
--%\\>.
JSPSyntax
Examples
<html>
<body>
<%-- This comment will not be visible to the colent in the page source --%>
</body>
</html>
A declaration declares one or more variables or methods for use later in the JSP
source file.
1.Declare variables or methods to use later in the file (see also Declaration).
2.Write expressions valid in the page scripting language (see also Expression).
3.Use any of the JSP implicit objects or any object declared with a <jsp:useBean> tag.
You must write plain text, HTML-encoded text, or other JSP tags outside the scriptlet.
Scriptlets are executed at request time, when the JSP engine processes the client request.
If the scriptlet produces output, the output is stored in the out object, from which you can
display it.
Certain objects that are available for the use in JSP documents without being
declared first. These objects are parsed by the JSP engine and inserted into the generated
servlet. The implicit objects re listed below
• request
• response
• pageContext
• session
• application
• out
• config
• page
• exception
39. Difference between forward and sendRedirect?
40. What are the different scope valiues for the <jsp:useBean>?
• page
• request
• session
• application
The generated servlet class for a JSP page implements the HttpJspPage interface
of the javax.servlet.jsp package. Hte HttpJspPage interface extends the JspPage interface
which inturn extends the Servlet interface of the javax.servlet package. the generated
servlet class thus implements all the methods of the these three interfaces. The JspPage
interface declares only two mehtods - jspInit() and jspDestroy() that must be
implemented by all JSP pages regardless of the client-server protocol. However the JSP
specification has provided the HttpJspPage interfaec specifically for the JSp pages
serving HTTP requests. This interface declares one method _jspService().
• The jspInit()- The container calls the jspInit() to initialize te servlet instance.It is
called before any other method, and is called only once for a servlet instance.
• The _jspservice()- The container calls the _jspservice() for each request, passing it
the request and the response objects.
• The jspDestroy()- The container calls this when it decides take the instance out of
service. It is the last method called n the servlet instance.
42. What is a output comment?
A comment that is sent to the client in the viewable page source.The JSP
engine handles an output comment as uninterpreted HTML text, returning the comment
in the HTML output sent to the client. You can see the comment by viewing the page
source from your Web browser.
JSP Syntax
Example 1
Active Server Pages (ASP) is a server-side scripting technology that can be used to
The response object transmits information from the web server to browser.
Methods are:
• Write
• BinaryWrite
• Redirect
• AppendToLog
• AddHeader
• Clear
• Flush
Java Server Pages (JSP) are simple technology used to generate dynamic HTML
on the server side.
48. Write down the various attributes for the page directives in JSP.
The page directive defines information that will be globally available for that Java Server
Page,
• Language
• Extends
• Import
• Session
• Buffer
• contenttype
49. Mention the rules of well-formed XML.
59. What are the different revolution in which XML is playing a major role?
Part –B
18. What is a DTD (document Type Definition) . What are its applications?
19. Write a XML schema for a Movie data base table with the following structure:
21. Write an ASP/JSP code to access a table and records from a student database to
obtain the result of a student.
22. List out objects associated with JSP/ASP and highlight the features of each object.
Explain the various JSP elements.
24. Write a DTD for the following schema (emp_id, emp_name(firstname, lastname),
dob(dd,mm,yyyy), address(city, state)).
25. Create a XML document to store voter ID, voter name, address and date of birth
details. Create a DTD to validate the document.