GNOME Bugzilla – Bug 53535
Using several parameters on command line
Last modified: 2009-08-15 18:40:50 UTC
It looks like we can't sepecify several parameters on the command line using --param. Test case: * Stylesheet (params.xsl): <?xml version= "1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:param name="param1"/> <xsl:param name="param2"/> <xsl:template match="/"> <xsl:if test="$param1"> PARAM1: <xsl:value-of select="$param1"/> </xsl:if> <xsl:if test="$param2"> PARAM2: <xsl:value-of select="$param2"/> </xsl:if> END </xsl:template> </xsl:stylesheet> * xml file (test.xml): <?xml version= "1.0"?> <doc/> * test: [rchaillat@pc-1229 modules]$ xsltproc --param param1 test1 --param param2 test2 params.xsl test.xml <?xml version="1.0"?> PARAM1: test1 END
Renaud Chaillat provided the fix, an off by one error :-\ thanks --------------------- --- libxslt-0.8.0/libxslt/xsltproc.c.orig Wed Apr 25 11:05:20 2001 +++ libxslt-0.8.0/libxslt/xsltproc.c Wed Apr 25 11:07:43 2001 @@ -87,7 +87,7 @@ (!strcmp(argv[i], "--param"))) { i++; params[nbparams++] = argv[i++]; - params[nbparams++] = argv[i++]; + params[nbparams++] = argv[i]; if (nbparams >= 16) { fprintf(stderr, "too many params\n"); return(1); ---------------------
shipped in libxsl-0.9.0 Daniel