Home / Interview / XSLT :: General Questions

Interview :: XSLT

1)

What is XSLT?

XSLT stands for EXtensible Stylesheet LanguageTransformation. It is used to transform XML documents into other formats (like transforming XML into HTML).

2) What is the usage of XSLT?

A list specifying the usage of XSLT:

  • XSLT is a language for transforming XML documents into XHTML documents or to other XML documents.
  • XSLT stands for Extensible Stylesheet Language Transformations.
  • It uses XPATH to navigate in XML documents.
  • XSLT uses XPATH to identify subsets of the source document tree and perform calculations.
3) What are the main parts of XSL document?
  • XSLT: It is a language for transforming XML documents into various other types of documents.
  • XPath: It is a language for navigating in XML documents.
  • XQuery: It is a language for querying XML documents.
  • XSL-FO: It is a language for formatting XML documents.
4) How is XSLT related to XSL?

XSLT stands for eXtensible Stylesheet Language Transformations. It is a language used to convert XML documents to XHTML or other XML documents. XSLT is nothing but transforming XSL's.

5) Explain the working of XSLT?

The XSLT stylesheet is written in XML format. It is used to define the transformation rules to be applied on the target XML document. The XSLT processor takes the XSLT stylesheet and applies the transformation rules on the target XML document and then it generates a formatted document in the form of XML, HTML, or text format. At the end it is used by XSLT formatter to generate the actual output and displayed on the end-user.

Image representation:

What is xslt 1
6) What are the advantages of using XSLT?
  • XSLT provides an easy way to merge XML data into presentation because it applies user defined transformations to an XML document.
  • Its output can be HTML, XML, or any other structured document.
  • XSLT provides XPath to locate elements/attribute within an XML document. So it is more convenient way to traverse an XML document rather than a traditional way, by using scripting language.
  • XSLT is template based. So it is more flexible to changes in documents than low level DOM and SAX.
  • XSLT makes the application UI script clean and easier to maintain.
  • XSLT templates are based on XPath pattern which is very powerful in terms of performance to process the XML document.
  • XSLT can be used as a validation language as it uses tree-pattern-matching approach.
  • You can change the output simply modifying the transformations in XSL files.
7)

What do you mean by XSLT element?

The XSLT element is used to extract the value of selected node. It puts the value of selected node as per XPath expression.

8)

What is the use of XSLT element?

The XSLT element is used to apply a template repeatedly on each node.

9)

What is the usage of XSLT element?

The XSLT element is used to specify a sort criteria on the nodes. It displays the output in sorted form.

10)

What is the usage of XSLT element?

The XSLT element is used to specify a conditional test against the content of the XML file.