Results 1 to 3 of 3

Thread: xpath query

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    xpath query

    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?

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

  2. #2
    Registered User nmadd's Avatar
    Join Date
    Jun 2007
    Location
    U.S.A.
    Posts
    1,676

    Re: xpath query

    So, you say that your info is in a string?

    Code:
                XmlDocument xd = new XmlDocument();
                xd.LoadXml(xmlString);
    
                XmlNode nod = xd.SelectSingleNode("/caller/userid");
                MessageBox.Show(nod.InnerText);

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    Re: xpath query

    thanks ill give that a bash

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width