Click here to Skip to main content
15,895,011 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a problem need help,
I have to rename an xml node in the xmlfile
the xml node is given as user input.
for eg.


XML
<Books>
<authors name="hello;
   <test name="di">
     <inputc name="">
     </input&gt;
     <a name="xsdf">
     </a>
  </test>
 </authors
</renamed</books>


Output should be

XML
<renamed>
 <authors name="hello">
   <test name="di">
     <inputc name=""
     </input>
     <a name="xsdf">
     </a>
   </test>
 </authors
</renamed>
Posted
Updated 21-Dec-12 2:27am
v2

1 solution

VB
For Each n As XmlNode In YourDoc.ChildNodes
    n.ChildNode(0).Name = n.Name + n.ChildNode(0).Name
Next

YourDoc.Save()
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900