Wrapping Arbitrary XML within XML

后端 未结 6 588
感动是毒
感动是毒 2021-01-05 07:53

I need to embed arbitrary (syntactically valid) XML documents within a wrapper XML document. The embedded documents are to be regarded as mere text, they do not need to be p

6条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-05 08:33

    When you escape the ending angular bracket of the inner CDATA, most XML parsers will not complain about the well-formedness of your XML. Using this "workaround", you should be able to nest multiple CDATA sections.

    Something like:

    
    
    
    
    ]]>
    
    

    Note that the inner CDATA has its ending ">" escaped as >.

提交回复
热议问题