After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 53535 - Using several parameters on command line
Using several parameters on command line
Status: VERIFIED FIXED
Product: libxslt
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Daniel Veillard
Daniel Veillard
Depends on:
Blocks:
 
 
Reported: 2001-04-24 14:45 UTC by rchaillat
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description rchaillat 2001-04-24 14:45:00 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
Comment 1 Daniel Veillard 2001-04-25 10:41:39 UTC
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);
---------------------
Comment 2 Daniel Veillard 2001-05-04 10:39:38 UTC
shipped in libxsl-0.9.0

Daniel