Chuck,
When I looked in the help file I found that the getNamedItem returns a Node,
not a string.
I still apprecite your help. Yeah, I didn't take the previous guy's advice.
What I ended up doing was reading the string into an xmlTextReader then
using xmlTextReader.GetAttribute("attribute name").
Mark
> Wrapping it in <root/> doesn't make it an xml document -
> its valid xml as is...
> Use the System.XML.XmlDocument to load the xml, then refer
> to the attributes in your node by using the
> documentElement property of your XmlDocument, and reading
> the values out of the ATtributes collection with
> getNamedItem:
> XmlDocument myDoc = new XmlDocument();
> myDoc.LoadXml(myInString);
> string firstName =
> myDoc.DocumentElement.Attributes.getNamedItem("FirstName");
> etc...
> >-----Original Message-----
> >You can wrap it into <?xml ...><root></root>, effectively
> creating a simple
> >XML document. Then you can feed the result to the
> XmlReader and access
> >attribute/values via DOM.
> >> Hi Everyone,
> >> I have a web service that returns an xml string like
> this:
> >> <USERS UserID="1" FirstName="Mark" LastName="Moeykens"
> CompanyName="Mark
> >> Moeykens, Inc."/>
> >> What is the best way to break this string apart to get
> the values out of
> >it?
> >> Thanks,
> >> Mark Moeykens
> >.