For very simple stylesheets that consist of only one template matching the root, a special simplified syntax is specified. In this simplified syntax, the whole document is the content of the template. The stylesheets that can use this simplified syntax are often doing transformations, mostly consisting of literals defining a template document. Only a few values from the source document are entered in specific locations.
The XML documents defining an article's content could be transformed by this stylesheet:
<HTML xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<BODY>
<H1><xsl:value-of select="/Article/Title"/></H1>
<p><b><xsl:value-of select="/Article/Intro"/></b></p>
<p><xsl:value-of select="/Article/Body"/></p>
</BODY></HTML>
XSLT Language Extensions
XSLT processor vendors are free to add their own private extensions to the language. The XSLT specification even specifies how they should indicate if an extension element or extension function is supported by their implementation.
In the stylesheet, certain namespaces can be specified to be XSLT extension
namespaces with the xsl:extension-element-prefixes
attribute on
the stylesheet element. Elements in those namespaces will be processed using
the extensions of the used processor.
If the stylesheet author wants to know if the processor supports a certain
extension element, the function element-available()
can be called
with the element name as the parameter. If the processor supports this element,
the function should return true.
Comments