Reading and Manipulating HTML inside XML CDATA

Dmonix

New Member
When I grab HTML from an XML CDATA section, manipulate it (in my case, perform C# string methods on the text within the CDATA section), and then display the edited version... it automatically comments out my first HTML tag:\[code\]<![CDATA[ <p>Lorem ipsum dolor sit amet...</p> ]]>\[/code\]converts to this on the page:\[code\]<!--[CDATA[ <p--> Lorem ipsum dolor sit amet... ]]>\[/code\]which breaks the styling for that first paragraph and renders the closing CDATA tag after the content.How do I fix this?EDIT:I couldn't find anything about this, so I tried a few things for poos and giggles, and this worked:\[code\]<![CDATA]> <p>Lorem ipsum dolor sit amet...</p> </]]>\[/code\]which converted to this on the page:\[code\]<!--[CDATA]--> <p>Lorem ipsum dolor sit amet...</p> <!--]]-->\[/code\]However... I'm not sure if this will affect my page in a negative way? Is there another way?
 
Back
Top