Lars Eskildsen wrote:
I want to be able to convert an XML snippet like:
<CONV_TAG>
<TAG1 ATTR1="VAL1">Statement: 4 < 5</TAG1>
<CONV_TAG>
to this XML code:
<CONVERTED_TAG>
<TAG1 ATTR1="VAL1">Statement: 4 &lt; 5</TAG1>
</CONVERTED_TAG>
Have a look at http://www.xmlportfolio.com/xml-to-string/
Note that it is a FAQ on this list that converting the output back into
a node-set or copying it to output without escaping, can be quite difficult.
The problem is i want to convert standard entities inside non-markup content.
< to <lt;
> to >gt;
& to &amp;
I don't think that's really what you meant. (<lt; should be &lt;,
right?) Regardless, you must understand that this in your XML, in the content
of an element...
Statement: 4 < 5
...is reported by an XML parser (to the XSLT processor) as the character data
Statement: 4 < 5
You have no access to the lexical details like entity references and character
references, just like you have no access to the fact that attribute values
might be quoted with " in some cases and ' in others. (Another FAQ)
- Mike
____________________________________________________________________________
mike j. brown | xml/xslt: http://skew.org/xml/
denver/boulder, colorado, usa | resume: http://skew.org/~mike/resume/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list