Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27333

Clear Data of XML but keep it's structure

$
0
0
Hello all,

I would like to keep the data in an xml but to keep the structure...

I am loading an xml file inside an XmlDocument with that way :

Code:

  XmlDocument doc = new XmlDocument();
            doc.Load(MyFile);

i want to clear the data of the xml, for expl if i have

Code:

<ROOT>
<person sex="female">
  <firstname>Anna</firstname>
  <lastname>Smith</lastname>
</person>
</ROOT>


i want it to become


Code:

<ROOT>
<person sex="">
  <firstname></firstname>
  <lastname></lastname>
</person>
</ROOT>


I found on msdn a method called removeall,

but this method removes nodes also, what i want is to keep the structure and clear only the data


Please help me about


Thanks in advance

Viewing all articles
Browse latest Browse all 27333

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>