Convert String to XMLDocument object

A

Andreas Håkansson

Pei,

If your string is wellformed xml then you could create an XmlDocument
from it by using

XmlDocument doc = new XmlDocument();
doc.LoadXml(myString);

where myString is the string which contains your wellformed xml data.

Hope this helps,

//Andreas
 
J

Jon Skeet [C# MVP]

Ravichandran J.V. said:
Use the XMLDocument object and load the string

xmDocObj.Load("String")

Not quite - it's the LoadXml method. Load(string) will treat the given
string as a URL.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top