Version 1 of XLST

Updated 2004-06-13 19:54:46

I started this page to capture an example of using XLST with Tcl from the Tcl News Group. Glenn Halstead

Posted by [email protected] on 12/06/2004 20:50

To invoke an extension in an XSL stylesheet, use the normal XSLT extension mechanism. The XML Namespace matches the extension to the registered Tcl namespace (NB. the stylesheet author is free to choose any prefix for the extension namespace). For example,

<xsl:stylesheet version='1.0'

    xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
    xmlns:eg='http://www.zveno.com/Example'>

  <xsl:template match='/'>
    <xsl:text>Result of calling extension is "</xsl:text>
    <xsl:value-of select='eg:myfunc("foo")'/>
    <xsl:text>".

</xsl:text>

  </xsl:template>

</xsl:stylesheet>

This stylesheet would result in the following Tcl script being evaluated:

::example::myfunc foo

Miko la honte