Re: [xsl] getting a single quote into a parameter

Subject: Re: [xsl] getting a single quote into a parameter
From: Peter Davis <pdavis152@xxxxxxxxx>
Date: Fri, 22 Feb 2002 16:05:20 -0800
On Friday 22 February 2002 13:56, Saverio Perugini wrote:
> $ testXSLT -in in.xml -xsl ss.xsl -out out.html -param tempParam "'hello
> &#39; world &#39; '"
>
> The entire parameter value needs to be single quoted for Xalan.

The problem is that the XPath expression needs to have double quotes on the 
outside and single quotes on the inside, but you have single quotes on both 
the outside and the inside.  The big problem is how to do this so your 
command shell won't interpret the quotes itself; if you have a Bash shell, 
this should work (backslash continues to next line):

$ testXSLT -in in.xml -xsl ss.xsl -out out.html -param tempParam \
\"hello\ \'world\ \'\"

So if you remove the backslashes as the shell will do, the XPath expression 
is:

"hello 'world'"

Which evauluates to:

hello 'world'

So <h3>"<xsl:value-of select="$tempParam"/>"</h3> should be:
<h3>"hello 'world'"</h3>

If you don't have a Bash shell, then you need to find out how your shell 
would allow escaping of the quotes like that.

-- 
Peter Davis
Real programmers don't write in BASIC.  Actually, no programmers write in
BASIC after reaching puberty.

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread