Subject:entity conversion Author:siva raman Date:21 Mar 2005 01:59 AM
Hello All,
pls help me in entity conversion in xml to xml mapping.
I need the same entity name (e.g. –) should come in output xml file.
Now I am using a entity file (with unicode values) with my xslt and get symbols instead of entities.
Subject:entity conversion Author:Tony Lavinio Date:22 Mar 2005 11:56 AM
In any XSLT engine, you cannot see the original entities.
The XML parser converts them into Unicode code-points, so XSLT only
sees them that way.
If you want to emit them again as entities, you must do the work
yourself.
XSLT 2.0 has a mechanism for handling that; you can build character-maps
(see http://www.w3.org/TR/xslt20/#character-maps for details). But there
is no way in XSLT itself to say "I saw a &tm; come in, and I want to
write it out as a &tm;" because that's the job of the serializer, which
comes AFTER the XSLT is done with the transform.
If you know the specific code-points, you can manually replace them,
but again that's harder in XSLT 1.0 since there is no search-and-replace
function like there is in 2.0, but one can be simulated. For help on
that, I would probably recommend the XSLT Cookbook by Sal Mangano.