Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

change root node name 1

Status
Not open for further replies.

russland

Programmer
Jan 9, 2003
315
CH
anybody a clue on how to change the root node name? (yes, i want to copy a xml but badly need to change the root element's name.)

attempting to use visual basic to do so.
thanks a lot in advance
 
Load in DomDocument, create another one, load with <new_rootname/>, then append childnodes from the original one?
It sure works, but I'm not sure about performance...
Or: just take it as a string, and replace text? You could work it out by finding the first occurence of &quot;/&quot;, and the last occurense of &quot;<&quot; etc etc.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top