Quantcast
Channel: Rename Root Node in XML
Browsing latest articles
Browse All 6 View Live

Rename Root Node in XML

// Create a new Xml doc object with root node as "NewRootNode" and // copy the inner content from old doc object using the LastChild. XmlDocument doc = new XmlDocument("FileName"); XmlElement newRoot =...

View Article



Rename Root Node in XML

Hey Ajay,hopefully the code below should serve your purpose; not sure how well it performs, but definitely does the job. using System;using System.Xml;using System.Xml.XPath;namespace QuickApp {class...

View Article

Rename Root Node in XML

how can i rename a specific node like:<group><a id="a"> t1 </a><b id="b"> t2</a></group> i want to change <b> into <c><group><a id="s"> t1...

View Article

Rename Root Node in XML

Hey Jason,thanks for providing that example. When testing I spotted that this does not currently copy over the attributes, so I've added in some code to do that. I've also got it to keep the prefix and...

View Article

Rename Root Node in XML

// Create and populate the XmlDocumentSystem.Xml.XmlDocument xDoc = new System.Xml.XmlDocument();xDoc.LoadXml("<xml><node/><node2/></xml>");// Create the new...

View Article


Rename Root Node in XML

I am working with C# and having trouble renaming the root node of an XML document.  I am unable to find the objs I need to accomplish this task.  Any suggestions short of string manipulation?  Thanks!

View Article
Browsing latest articles
Browse All 6 View Live




Latest Images