/ Published in: C#
XmlDocument will not behave when you try to CreateCDataSection passing it a string that contains "]]>"
This extension method returns an array of XmlCDataSection, each of which will contain the parts separated by "]]" and ">". Example:
For the string "This string contains ]]>, and ]]> is invalid within CData sections", the return value will be an array containing the following XmlCDataSections:
"This string contains ]]"
">, and ]]"
"> is invalid within CData sections"
which works beautifully.
Optimizations are welcome.
This extension method returns an array of XmlCDataSection, each of which will contain the parts separated by "]]" and ">". Example:
For the string "This string contains ]]>, and ]]> is invalid within CData sections", the return value will be an array containing the following XmlCDataSections:
"This string contains ]]"
">, and ]]"
"> is invalid within CData sections"
which works beautifully.
Optimizations are welcome.