Hello, I have a little problem when saving my xml file. I use an instance of System.Xml.Document. I load an xml document file and edit this file with an application, then when I save it (doc.save("file.xml") ), I would like also the whitespaces being saved.
Example:
<element>
<subElement> </subElement>
</element>
It saves correctly the whitespaces, but when I read it again, the whitespaces are trimmed! To prevent that, I would like to replace whitespaces by : but on saving the xml writer encodes this sequence into : and therefore it is not interpreted as a whitespace anymore... :(( Any help would be really appreciated, thanks in advance!
System.Xml.Document : How to write special characters in an xml file ?
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
crausch55 pointsPosted Sep 29, 2005, 8:16 AM EDT
Also, Instead of using the decimal (base 10) entity, try using the (base 16) UniCode entity as in