|
 |
|
NOTE: This Design document is subject to change at any time. |
XSL
Syntax: <XSL property-list>XSL-contents</XSL>
This is object encapsulates the Extensible Stylesheet Transformation (XSLT) specification. It can be used to transform XML data into various forms.
This object can be defined in your ZML file and then it's name can be assigned to the zXML.XSL property of a zXML object to transform that particular XML data. Or, you can define the XSL object as a child of the XML object that it acts upon. For example:
Code: |
<XML Name='MyXML' Filename='test.xml'>
<XSL Name='MyXSL' Filter='HTML'/>
</XML> |
The XSL property of the zXSL object defines the text of the style sheet to be applied. Or, you can use the Filename property to read the XSL style sheet from a file. You can also put your style sheet directly into the ZML file. For example:
Code: |
<XSL Name='MyXSL' Filter='XML'>
<xsl:stylesheet version='1.0'>
<xsl:template match="node() | @*">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="raisepanel">
<xsl:element name="panel">
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
</XSL> |
defined a style sheet that will transform the input XML file (a zApp ZML file in this case) and rename any "raisepanel" tag to "panel" (getting rid of the outdated raisepanel tag in zml files).
NOTE: The first template in the above example is a very useful starting template that will copy any input XML file to the output unchanged. This "copy" template is often the basis for many XML transformations.
The zXSL component supports formatting objects for HTML, RTF, and XML. This is set via the Filter property. You can implement your own custom formatting by setting Filter to "None" and implementing the various event scripts shown on the left. These events allow you to perform any actions you want when processing a XSLT filter.
A full discussion of XSLT and it's syntax is beyond the scope of this documentation. |
|