Re: [xsl] Escape Special Characters

Subject: Re: [xsl] Escape Special Characters
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 25 Oct 2004 00:24:44 +0100
> I'm baffled by this use of &amp;. I have to use it
> twice for each & sign in the URL to get the variables
> passed correctly. Does someone have explanation for
> this?

You didn't show the output you got, or the correct output thatyou
wanted.
The output from the code you showed should be rather odd.
Most of your text is in xsl:text and the usual reason for using xsl:text
is to allow indentation of teh stylesheet without it affecting the
result tree, but you also have non-white characters in your text nodes
(&amp;) so the whole text node will be copied to teh output.

	<xsl:attribute name='src'>
		<xsl:text>./php/chart_age.php?     age1=</xsl:text>
		<xsl:value-of select="AGE1"/>&amp;
		<xsl:text>&amp;age2=</xsl:text>

after the value of AGE1 you generate the character & followed by a
newline two tabs then another &.
As this is in an attribute value where white space would be normalised,
the XSLt engine will have to quote the white space so i would expect
that you woul dget something like
 age1=33&amp;&#10;&#9;&#9;&amp;age2=...

David


________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

Current Thread