Subject:retaining named entities Author:Manikandan Surendranath Date:06 Jun 2005 06:41 AM
The XSLT (v 1.0) that I have written reads a XML file and outputs a transformed XML file (ASCII encoding). After this transformation process, the named entities like ’ are changed to   and ’. I know that these are being picked up from DTD. My client processor is compatible to XSLT 1.0 only and therefore I can not use character map.
Can some one tell me how to avoid this or is there a patch?
Subject:retaining named entities Author:Tony Lavinio Date:06 Jun 2005 09:06 PM
By the time any XSLT engine sees the data, it has been parsed by the
XML parser. And all XML parsers expand entities when building the
infoset. So not only is there no patch to fix this, there is not a
way for any XSLT engine to know whether a sequence of characters was
explicit or came from some entity, because XSLT deals not with the
input stream directly, but with a view of the world as all Unicode
text. (This is also why you can't tell if your input is from a literal
text element or CDATA.)
In order to produce them as output, you need something like the
character maps of XSLT 2, or you must post-process the output.
You could write a simple post-processor, say in Java, and place it in
the scenario properties as the post-processor, and we will call it for
you.