This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: getting a single quote into a parameter


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]