Subject: RE: [xsl] double escaping problem [re-visited] From: pkeane <pkeane@xxxxxxxxxxxxxxx> Date: Tue, 13 Nov 2007 08:28:45 -0600 (CST) |
The document() function invokes an XML parser and it can only do what an XML parser does.
In fact an XML parser removes one level of escaping, and a serializer adds it back. So the parser turns "&" into "&" and "&amp"; into "&", and the serializer turns them back into "&" and "&amp;" respectively, unless d-o-e is set, in which case they are turned into "&" and "&" respectively. All the evidence is that your XML source as read by the parser was actually double-escaped. This quite often happens when you have fragments of XML stored in a database: if you try to extract it as XML, and the database software doesn't realise that it's already in XML format, then the database software adds a level of escaping that you don't want. The way to get rid of it is to change the way you do the database query.
Michael Kay
many thanks! Peter Keane
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] double escaping problem [, Michael Kay | Thread | [xsl] fo:inline within fo:basic-lin, Khaled Aly |
Re: [xsl] Single output from many i, David Sinclair | Date | RE: [xsl] Single output from many i, Bjorndahl, Brad |
Month |