Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: xerces serializing <

From: yf110@----.--------.--.-- (------- ---------)
To: NULL
Date: 11/2/2005 1:43:00 PM
shaun roe (shaun.roe@w...) wrote:
: a follow up with new problems from my previous post:

: I have xml encoded in a string with elements like &lt;myElement/&gt;

: e.g 

: <codeFragment> &lt;myElement&gt;some text&lt;/myElement&gt; 
: </codeFragment>

: I parse this in Xerces and I can see it has done the correct thing,
: but now I want to serialize the output so it **looks** like valid xml, 
: i.e.
: <codeFragment> <myElement>someText</myElement> </codeFragment>

: this doesnt happen; instead I get 

: <codeFragment> &lt;myElement>someText &lt/myElement> </codeFragment>

: I dont want to change the DOM model, I just want the serializer to 
: output text which has the "<" in it. Is there some way of stopping it 
: escaping the "<" ?

: note: unfortunately I am restricted to simple text in the node, I cannot 
: insert a CDATA. (not sure this would solve it anyway).


Is there some option to _not_ escape the text?  I know that using xalan
you can use an option (it's part of xlst) to not escape text.  Since xalan
is based on xerces, I wonder if it is xerces that has an option to do
this?

OR

Take your text after it is un-escaped and parse that a second time.  Now
take that small node tree and splice it into the original in place of the
text that contained the escaped < & >'s.  When the whole is serialized
then that part of the xml will be output with tags as you wish. ($0.10)

--

This programmer available for rent.


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent