|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: passing top level param?
Hi
"Martin Algesten" <martin.algesten@xxxxxxxx> writes:
> The XSL Transformation v1.0 spec says about passing top level params:
> "XSLT does not define the mechanism by which parameters are passed to the
> stylesheet"
>
> Does anyone now if any xslt processors does this?
XT does. You can pass parameters to the processor with param=value
argument. You must have a top level xsl:param element with the same
name. Thus, this stylesheet :
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:param name="param">default</xsl:param>
<xsl:template match="/">
<xsl:call-template name="test"/>
</xsl:template>
<xsl:template name="test">
<xsl:value-of select="$param"/>
</xsl:template>
</xsl:stylesheet>
called with any xml file like this :
java com.jclark.xsl.sax.Driver test.xml test.xsl param=value
Will output "value".
--
+---------------------------+--------------------------------+
| Michel CASABIANCA | http://www.sdv.fr/pages/casa |
| mailto:casa@xxxxxx | Articles sur Java et XML |
| Développement Java et XML | Applications et Applets de Jeu |
+---------------------------+--------------------------------+
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








