Results 1 to 3 of 3

Thread: Getting XPath of an XMLNode

  1. #1

    Thread Starter
    Randalf the Red honeybee's Avatar
    Join Date
    Jun 2000
    Location
    off others' brains
    Posts
    4,345

    Getting XPath of an XMLNode

    I have an XML document. While reading it using the System.XML.XMLDocument object, I want to retrieve the XPath of each XMLNode that I am reading. Does anyone have any idea how it can be done?

    .
    I am not a complete idiot. Some parts are still missing.
    Check out the rtf-help tutorial
    General VB Faq Thread
    Change is the only constant thing. I have not changed my signature in a long while and now it has started to stink!
    Get more power for your floppy disks. ; View honeybee's Elite Club:
    Use meaningfull thread titles. And add "[Resolved]" in the thread title when you have got a satisfactory response.
    And if that response was mine, please think about giving me a rep. I like to collect them!

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Getting XPath of an XMLNode

    How do you get to the node whose XPath you want to figure out in the first place? Or are you asking how you can use XPath to get a node value?

  3. #3

    Thread Starter
    Randalf the Red honeybee's Avatar
    Join Date
    Jun 2000
    Location
    off others' brains
    Posts
    4,345

    Re: Getting XPath of an XMLNode

    Quote Originally Posted by mendhak
    How do you get to the node whose XPath you want to figure out in the first place? Or are you asking how you can use XPath to get a node value?
    I am using an XMLDocument object to traverse through the nodes. Now the XML file that I have to process has been structured in a way that some elements are repeated. For e.g. the Customer and Vendor nodes follow the same structure i.e. a Name element, an Address element and a Telephone element. While reading the document I would like to distinguish between the Customer set of elements and the Vendor set of elements. I hope you get the picture.

    Now I could try to do this manually, but it is not proving fruitful. So just wanted to see if there was some way to get the XPath of a particular node when I am reading it off the XMLDocument tree.

    .
    I am not a complete idiot. Some parts are still missing.
    Check out the rtf-help tutorial
    General VB Faq Thread
    Change is the only constant thing. I have not changed my signature in a long while and now it has started to stink!
    Get more power for your floppy disks. ; View honeybee's Elite Club:
    Use meaningfull thread titles. And add "[Resolved]" in the thread title when you have got a satisfactory response.
    And if that response was mine, please think about giving me a rep. I like to collect them!

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