I am trying to feed xsltproc a stringparam that contains a break... It does not seem to work. Minimal example below.
This is bogus.xml
:
<?xml version="1.0" encoding="UTF-8"?>
<this>
<that/>
</this>
This is test.xsl
:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="somestring" select="'here is a break'"/>
<xsl:template match="/">
<xsl:message>|<xsl:value-of select="$somestring"/>|</xsl:message>
</xsl:template>
</xsl:stylesheet>
And this is my command line:
xsltproc --stringparam somestring 'another string with a break' test.xsl bogus.xml
And the output looks like this:
|another string with a break|
The output I want is this:
|another string with a
break|
When using Bash this can be achieved like this:
xsltproc --stringparam somestring $'another string with a\nbreak' test.xsl bogus.xml
For more information about ansi-c quoting see here