How to get the XmlTextWriter to actually write the & (without CDATA)

Wassoufi

New Member
I am using XMLTextWriter to serialize a bunch of my objects into HTML (since HTML is basically XML), and all of my objects are able to read/write themselves as XML anyway. The method works great except for one small snag. HTML has some invalid XML such as   for a space. The TextWriter always converts this to &nbps;. I can not wrap this in a CDATA tag because the browser will simply ignore the tag, I literally need the XmlTextWriter to leave my & alone.
 
Back
Top