xsl-list
[Top] [All Lists]

[xsl] passing parameters to xsl stylesheets

2007-05-20 07:41:09

Hi all
Will you  help me please?
I'm trying to pass a parameter to the following  xsl stylesheet:


<?xml version="1.0" encoding="ISO-8859-1" ?>
- <xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
  <xsl:param name="toto" />
- <xsl:template match="/note">
-    <html>
-    <body>
      <xsl:value-of select="$toto" />
  </body>
  </html>
</xsl:template>
</xsl:stylesheet>
 
The xml file which uses the xsl file is simply:
 
<?xml version="1.0" ?>
- <note>
    <to>Tove</to> 
    <from>Jani</from>
</note>
 
To pass the parameter I use this command:
$ xsltproc --stringparam toto 'from' myxslfile.xsl myxmlfile.xml
 
The result is:
<html><body>from</body></html>
While I was expecting <html><body>Jani</body></html>
 
Thank you in advance!!
Youness (france)


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--