Hi everyone, I have a little problem with the class XmlDocument in .net. I'm using framework 2.0 and I am loading an xmlDocument from a path. The xml has a node without value like this:


When I load the xml using the xmlDocument class, it seems that it is internally modified to read this as:


where "_" is a white space. Does somebody know how to prevent this from happening ? It is very important to me to read all xml's EXACTLY as they are without suffering any kind of change.

Any help or ideas will be greatly appreciated :)

6 Years
Discussion Span
Last Post by dmarvp

My xml is really big, but the only problem I have is in a node without value that has exactly this form:


My vb code is really simple as well :

Dim xmlDoc As New Xml.XmlDocument
 Dim pathToXml as String = "C:\xmlExample.xml"

at this point when I do an inspection on xmlDoc.InnerXml the previous node has changed from : <Datos_Contacto/> to <Datos_Contacto /> (with a white space before the slash). It is critical for me to preserve the original xml once loaded.

Any ideas ?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.