This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: getting a single quote into a parameter
- From: Peter Davis <pdavis152 at attbi dot com>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Fri, 22 Feb 2002 16:05:20 -0800
- Subject: Re: [xsl] getting a single quote into a parameter
- References: <Pine.OSF.4.33.0202221647120.5389-100000@csgrad.cs.vt.edu>
- Reply-to: xsl-list at lists dot mulberrytech dot com
On Friday 22 February 2002 13:56, Saverio Perugini wrote:
> $ testXSLT -in in.xml -xsl ss.xsl -out out.html -param tempParam "'hello
> ' world ' '"
>
> 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