string to xml

btisdabomb

Member
Joined
Jul 12, 2006
Messages
16
Programming Experience
Beginner
I'm not sure if this is the correct forum to post this but here it is anyways...

I am using a webservice that returns a string. The string is in xml format. How do I convert that into something in xml where I can parse through it? Or if there is an easier way to parse it let me know.

Here is an example of what gets put into the string.

<?xml version="1.0"?><Root><Cookie/><Status>0</Status><Params/><TextValue>"R-DirectoryServices" found in list.</TextValue><Errors/></Root>
 
Well, there should be an XML object class somewhere in the framework... worst case, load it into a DataTable (or a DataSet)....

-tg
 
XML Document

See System.Xml.XMLDocument class:
ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/CPref19/html/T_System_Xml_XmlDocument.htm
"
This class implements the W3C Document Object Model (DOM) Level 1 Core and the Core DOM Level 2. The DOM is an in-memory (cache) tree representation of an XML document and enables the navigation and editing of this document. Because XmlDocument implements the IXPathNavigable interface it can also be used as the source document for the XslTransform class.

The XmlDataDocument class extends XmlDocument and allows structured data to be stored, retrieved, and manipulated through a relational
 
Adding to Greg1997s hint about XmlDocument, that class got a LoadXml method that will read Xml document from a string. Example:
VB.NET:
Dim xdoc As New Xml.XmlDocument
xdoc.LoadXml(theString)
 
Back
Top