Home
XSLT Processor
Website Editor
CGI XSLT Processor
The style and source
Global parameters
Stylesheets
Stylesheet elements
Functions
Files upload
Details
Characters model
Data types
Result tree fragments
Variables scope
Conflict resolution
The key function
The document function
Curly brackets in attributes
Extensions
Extension modules
XSL message handlers
XML tree class
XSLT stylesheet elements

CGI XSLT processor supports the following instructions
xsl:apply-templates, xsl:attribute, xsl:call-template, xsl:choose, 
xsl:copy, xsl:copy-of, xsl:comment, xsl:element, xsl:for-each,
xsl:if, xsl:message, xsl:otherwise, xsl:param, xsl:sort, 
xsl:text, xsl:value-of, xsl:variable, xsl:when, xsl:with-param.
<!-- version>=1.5 -->
xsl:processing-instruction
xsl:include for dynamical inclusion of stylesheets href must be a string, 
expressions are not supported
http:headers, http:field extension elements
The xsl:sort instruction is implemented with the default Perl sort function. Hence, language dependent sorting may be incorrect.

Not XSLT xml-document element controls the program output to the local disk. It must be a top node of the result tree or a top element of xsl:message. It is not an extension element. Executing stylesheet xsltp.pl XSLT processor treats this element as any literal element. A required attribute of the xml-document element is the system attribute. You can use the xsl:attribute instruction to set the system attribute. The content of the xml-document element will be saved in a file. The name of the file is defined by the system attribute value and by the xsltp:xml-base top element. Optional attributes are method=xml|html|text, omit-xml-declaration="yes" and encoding (real encoding of the output, bytes or utf-8). The result tree root can have any number of the xml-document element children. Example
<xsl:tamplate match="/">
<html>...</html>
<xml-document system="{myfile string expression}.xml" method="xml" encoding="bytes">
...
</xml-document>
</xsl:template> 
Html element with its content will be output to STDOUT. Content of xml-document will be saved to the file.

The xsl:message instruction prints its content immediately without waiting the end of the transformation. The following example serves for an illustrative goal only.
<xsl:tamplate match="/">
<table>
<xsl:message>
<xsl:text disable-output-escaping="yes"> <![CDATA[<html><body>]]> </xsl:text>
</xsl:message>
template calls here
</table>
<xsl:text disable-output-escaping="yes"> <![CDATA[</html></body>]]></xsl:text>
</xsl:template> 
The above code output is <html><body><table>.... In fact, you can omit xsl:text here, for xsltp.pl XSLT processor never escapes the text node children of the result tree root. The content of xsl:message is also treated as a result tree. It is worth mentioning that you can store the intermediate result tree in a file using combination of xsl:message and xml-document elements. After execution of the xsl:message block it is possible to load the intermediate result tree with the document function and continue the transformation.
Copyright © 2004 www.dopscripts.com