[xml/sgml-pkgs] Bug#548586: Bug#548586: xsltproc: --stringparam does not accept strings containing both single and double quotes

Mike Hommey mh at glandium.org
Sun Sep 27 13:24:44 UTC 2009


On Sun, Sep 27, 2009 at 02:45:48PM +0200, Jakub Wilk wrote:
> Package: xsltproc
> Version: 1.1.26-1
> Severity: normal
> 
> $ 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>

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





More information about the debian-xml-sgml-pkgs mailing list