0

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:

<somexmlnode/>

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

<somexmlnode_/>

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 :)

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by dmarvp
0

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

<xml>
.
.
.
<Datos_Contacto/>
.
.
.
</xml>

My vb code is really simple as well :

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

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.