#548586 xsltproc: --stringparam does not accept strings containing both single and double quotes

Package:
xsltproc
Source:
libxslt
Description:
XSLT 1.0 command line processor
Submitter:
Jakub Wilk
Date:
2011-10-25 23:15:08 UTC
Severity:
normal
#548586#5
Date:
2009-09-27 12:45:48 UTC
From:
To:
$ cat test.xslt
<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:param name='foo'/>
<xsl:template match='/'>
<root><xsl:value-of select='$foo'/></root>
</xsl:template>
</xsl:stylesheet>

$ echo '<root/>' | xsltproc --stringparam foo "\"'" test.xslt -
stringparam contains both quote and double-quotes !


Note that there *is* a way to pass such a string as a parameter, although
a convoluted one:

$ echo '<root/>' | xsltproc --param foo "concat('\"', \"'\")" test.xslt -
<?xml version="1.0"?>
<root>"'</root>

#548586#10
Date:
2009-09-27 13:24:44 UTC
From:
To:
There is actually a good reason this is not possible, and that is
because stringparam is only a shortcut for param, quoting the string
with either ' or " depending on the fact that it contains " or '. If
it contains both, the string can't be quoted.

Mike