> Greetings to all,
> Does anyone know, how to retain the Character entity reference in
> the output XML after XSL transformation.
With XSLT 2 you can use the character map feature to map specific
characters to any string in the output, including an entity reference.
However, this requires you to define a mapping for each
character--there's no way to have a generalized entity-preserving mechanism.
One way to do this out side of, but in concert with your XSLT processor,
is to create a custom SAX filter that escapes entity references before
the XML data stream is passed to the XSLT processor. For example, you
could use the SAX filter to change entity references to elements and
then use template rules to output the corresponding entity reference for
those tags, e.g.:
˜ -> SAX filter -> <mystuff:entityref name="tilde"/> -> XSLT:
W. Eliot Kimber
9390 Research Blvd, #410
Austin, TX 78759