0

I Have a xml model like that:

<tag1>
...
    <![CDATA[
        <tag2/>
        ...
        <![CDATA[
            <tag3/>
            ...
        ]]]]><![CDATA[>
    ]]>
</tag1>

I try to use c# XmlSerializer but don't find a way to generate one CDATA wrapped by another. I try create inner CDATA and that add result to model and serialize that model, but can't do that, cause get InvalidOperationException, case CDATA block has ']]>'. As field in model for CDATA block i use XMLCDataSection. Do you have any idea?

Robert
  • 1
  • Possible duplicate of [How do you serialize a string as CDATA using XmlSerializer?](http://stackoverflow.com/questions/1379888/how-do-you-serialize-a-string-as-cdata-using-xmlserializer) – Manfred Radlwimmer May 15 '17 at 10:08
  • A have never seen garbage like that before. You would need a custom parser. I could write a recursive parser very easily, but would need a better sample of the file. – jdweng May 15 '17 at 10:15

0 Answers0