PDA

Click to See Complete Forum and Search --> : xpath query


Techno
Jul 31st, 2007, 11:16 AM
in .NET 1.1, I wish to do some xml searching/node searching using xpath and an xml string.

I have this xml here:

<caller><userid>{540C8042-A520-DC11-AE79-00132047A063}</userid><merchantid>{59344736-A520-DC11-AE79-00132047A063}</merchantid></caller>


how can I obtain the <userid> value (the GUID) from that given string?

nmadd
Jul 31st, 2007, 12:21 PM
So, you say that your info is in a string?

XmlDocument xd = new XmlDocument();
xd.LoadXml(xmlString);

XmlNode nod = xd.SelectSingleNode("/caller/userid");
MessageBox.Show(nod.InnerText);

Techno
Jul 31st, 2007, 12:49 PM
thanks ill give that a bash