How to transport an XML fragment in an XML Document

Posted by mrwayne on Stack Overflow See other posts from Stack Overflow or by mrwayne
Published on 2010-05-11T22:46:21Z Indexed on 2010/05/12 2:14 UTC
Read the original article Hit count: 908

Hi,

I'm using an AJAX system on a web application, and for one of the objects i return, it needs to contain an xml fragment. Unfortunately, being AJAX, i'm sending the values back via XML already.

So, at the moment, i have something that looks like this (ignoring the fact the tags arent perfect.

<Transport>
   <Message>
      <Content><[CDATA...] XML Content in here </Cdata></Content>
   </Message>
</Transport>

This has worked pretty well for the last few years, however, now the XML content itself needs to contain its own CDATA tags and its causing me grief because you cannot nest CDATA sections. Is there another way to encode the 'XML Content' internally?

© Stack Overflow or respective owner

Related posts about Xml

Related posts about xml-serialization