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



-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to