Re: [xsl] Problem with ampersands

Subject: Re: [xsl] Problem with ampersands
From: Jeff Sese <jsese@xxxxxxxxxxxx>
Date: Tue, 26 Sep 2006 15:47:19 +0800
Joe Fawcett wrote:
Jeff

I understand the unreasonableness of many requirements but I don't understand what's happening here. Surely if you transform an XML document to another XML document then any ampersands in the output will still be escaped on serialisation?

Joe

<test>&amp; test test the quick brown fox text&amp;chkeiubareiubareiubar;text test test the quick brown fox&chkeiubareiubareiubar;</test>

What i want to achieve in my output is to make the text
'&amp;chkeiubareiubareiubar;' appear as '&chkeiubareiubareiubar;'. but
if i add a d-o-e=yes attribute on my xsl:value-of then the ordinary
'&amp;' character in my output will become '&' and i don't want that.
Transforming an xml to another xml, the charcters '&, < and >' will be
outputted as '&amp; &lt; and &gt;', by default unless i specify a d-o-e
attribute or use character-map. I have no problems with the entity
references that points to single characters, i having problems with the
multi character ones and i'm trying to solve them using the search and
replace all method in my stylesheet. If there is a better approach to
achieve my output then i welcome any suggestions.

Thanks,
-- Jeff

Current Thread