What is the main purpose of XSLT?
B
To transform XML documents into other formats like HTML or text
Analysis & Theory
**XSLT** is used to **transform XML documents** into other formats such as HTML, plain text, or other XML structures.
Which tag is used to declare an XSLT stylesheet?
Analysis & Theory
`<xsl:stylesheet>` is the standard root element for defining an XSLT stylesheet.
Which attribute links an XML file to an XSLT stylesheet?
Analysis & Theory
The `<?xml-stylesheet type='text/xsl' href='style.xsl'?>` processing instruction links an XML document to an XSLT file.
Which tag in XSLT is used to **match elements** from the source XML?
C
<xsl:template match='...'>
Analysis & Theory
`<xsl:template match='...'>` defines a **template** that applies to specific elements in the source XML.
What does `<xsl:value-of select='title'/>` do?
A
It creates a new XML element called 'title'
B
It adds the title attribute to the output
C
It outputs the **text value** of the `<title>` element
D
It validates the title element
Analysis & Theory
`<xsl:value-of>` outputs the **text content** of the selected element or attribute.
What does `<xsl:for-each select='book'>` do in XSLT?
B
Iterates over each `<book>` element in the source XML
C
Sorts the books alphabetically
D
Adds a new book to the XML
Analysis & Theory
`<xsl:for-each>` is used to **loop through nodes**, such as all `<book>` elements in a list.
Which element is used to apply templates to child elements in XSLT?
Analysis & Theory
`<xsl:apply-templates>` applies templates to **child nodes** of the current node.
What is the output of an XSLT transformation?
C
It depends on the XSLT and output settings
Analysis & Theory
XSLT can output **XML, HTML, or plain text** depending on the `<xsl:output>` declaration.
Which of the following sets the output to HTML in XSLT?
A
<xsl:output type='html'/>
B
<xsl:output method='html'/>
D
<xsl:method type='html'/>
Analysis & Theory
Use `<xsl:output method='html'/>` to declare that the result of the transformation should be HTML.
Which of the following statements about XSLT is TRUE?
A
XSLT can only be used in browsers
B
XSLT modifies the original XML file
C
XSLT is a declarative language used for transforming XML
D
XSLT is used for creating XML schemas
Analysis & Theory
**XSLT is a declarative language** that describes rules for transforming XML documents without modifying the source.