Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: CDATA vs Escaping XML Characters

From: "Julian F. Reschke" <julian.reschke@-----------------.-->
To: NULL
Date: 6/2/2006 9:54:00 AM

sudhakarnraju@g... schrieb:
> Hi,
> There's a need to generate xml documents in our project and in one of
> the node, it can contain some snippets of code which can have <, > and
> other xml symbols
> e.g
> <Code>
> If i > 100 && j < 200
> ...
> End If
> </Code>
> 
> Question is: Should I XMLEncode the node text  ( &lt;, &gt; etc) OR
> should I put them in CDATA attrib.
> 
> Is there a difference between usage of the above 2 options. I beleive
> they are part of same XML standard and are interoperable. Please confirm

Confirmed.

Hint: unless human readability of the XML is a major concern, I'd avoid 
CDATA altogether. It's just not needed and adds potential complexity 
(escaping of "]]>"...).




transparent
Print
Mail
Digg
delicious
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