XSL INTERVIEW QUESTIONS AND ANSWERS

15+ TOP XSL Interview Questions

XSL Interview Questions
XSL Interview Questions

1) What is XSL?
XSL stands for Extensible Stylesheet Language. It is used for expressing stylesheets like CSS which describes how to display an XML of given type.

2) What is XSLT?
XSLT is a Extensible Stylesheet Language Transformation. It is used to transform XML documents into other formats like transforming XML into HTML.

3) Who developed XSLT?
XSLT was developed by World Wide Web consortium.

4) How XSLT is related to XSL?
XSLT is extensible Style sheet Language. It is used to convert XML document to XHTML or other XML documents. XSLT is transforming XSL’s.

5) What are the important parts of XSL documents?
Following are the important parts of XSL documents:-
XSLT- It is used to transforming XML documents into various other types of documents.
Xpath- It is used to navigating in XML documents.
Xquery- It is used for querying XML documents.
XSL-FO- It is used for formatting XML documents.

6) What are the Roles of XSLT?
Following are the roles of XLST-
It is used to transform an XML document into another XML document like HTML,etc.
It is used for rearranging and sorting elements.
It is used to add or remove elements and attributes to output file.
It is used to performing tests and making decisions about hiding and displaying of elements.

7) What are the advantages of XSLT?
Following are the advantages of XSLT:
It provides easy 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 documents.
It makes the application UI script clean and easier to maintain.
It used as a validation language as it uses tree-pattern-matching approach.
We change the output simply modifying the XSL files.

8) What is XSLT <xsl: for-each> element?
The XSLT <xsl: for-each> element is used to apply a template repeatedly for each node.

Syntax:

<xsl:for each

select=Expression>

</xsl:for each>

Select- It is used to evaluated in current context to determine the set of nodes to be iterated.

9) What is the usage of XSLT <xsl: if> element?
The XSLT <xsl: if> element is used to specify the conditional test against the content of XML file.

Syntax:

<xsl: if test=”expression”>

…some output if the expression is true…

</xsl:if>

test: It specify a condition in xml data to test.

10) What do you mean by XSLT <xsl: choose> element?
XSLT <xsl: choose> element is used to specify a multiple conditional test against the content of nodes. It is used with <xsl:otherwise> and <xsl:when> elements.

Syntax:

<xsl:choose>

<xsl:when test=”expression”>

…some output…

</xsl:when>

<xsl:otherwise>

…some output…

</xsl:otherwise>

</xsl:choose>

test: It specify a condition in xml data to test.

11) What is use of XSLT <xsl: key> element?
XSLT <xsl: key> is used to specifies a named name-value pair assigned to specific element in an XML document. This key is used with the key() function in XPath to access the assigned elements in an XML document.

Syntax:

Declaration of <xsl:key> element.

<xsl:key

name = QName

match = Pattern

use = Expression>

</xsl:key>

Name- It specify the name of the key to be used.

Match- It shows that the pattern must be matched to a node that holds this key.

Use- It indicate XPath expression to identify the value of the nodes of xml document.

12) What is use of XSLT <xsl: message> element?
It is used to display the error message and help to debug the XSLT processing. It is similar to JavaScript alerts.

13) What is use of XSLT <xsl: apply-template> element?
The XSLT <xsl: apply-template> element is used to tell XSLT processor to find the suitable template to apply according to the type and context of each selected node.

Syntax:

<xsl: apply template

select = Expression

mode = QName >

</xsl:apply-template>

Select: It is used to process nodes selected by XPath expressions from list of all anodes and its child.

Mode: It is used to allow an element as specified by its qualified names to be processed multiple times and every time producing a different result.

14) What is use of XSLT <xsl: import> element?
It is used to import content of one stylesheet to another stylesheet. The importing stylesheet has higher priority over imported stylesheet.

Syntax:

<xsl:import href=”uri”></xsl:import>

href: Parameter is used to provide path of xslt stylesheet to be imported.

Real Time XSL Interview Questions