[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: passing top level param?

Subject: Re: passing top level param?
From: Michel CASABIANCA <casa@xxxxxx>
Date: 31 Mar 2000 11:01:50 +0200
xsl 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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.