Tuesday, February 2, 2010

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.

What are the roles of XSLT?

The roles of XSLT are:
XSLT is used to transform an XML document into another XML document such as HTML, etc.
XSLT can be used to add or remove elements and attributes to or from the output file.
XSLT can also be used for rearranging and sorting elements.
It can also be used for performing tests and making decisions about hiding and displaying of elements
.
XSLT and XPATH-

 What is XSLT? Explain its relationships with XSL.

XSLT stands for eXtensible Stylesheet Language Transformations. It is a language used to convert XML documents to XHTML or other XML documents. This conversion is done by transforming each XML element into an (X)HTML element.. it uses XPath to find information in a XML document. XSLT is nothing but transforming XSL’s. Xpath defines the parts of the source document that must match one or more predefined templates. Once a match is found, XSLT will transform the match into the result document.

What is XSLT stylesheet?

XSL stylesheet is just like a XML document used as a program text or a source. It contains sets of rules and instructions used for transformations. XSLT stylesheet along with the XML source documents are the inputs to the XSLT processor. The template rule contains two parts: a pattern used to match the nodes in the source document and a template which can be instantiated to form part of the result tree. A stylesheet is represented by an xsl:stylesheet element in an XML document.

Discuss the role of XPATH.

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.

Explain the XSLT data model.

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.

0 Comments: