SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict ArunB's Avatar
    Join Date
    Jun 2008
    Location
    Hyderabad
    Posts
    252
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question URGENT: XPath doubt

    I have XML as:
    Code XML:
    <As>
        <A>
    	<AID>A1</AID>
        </A>
        <A>
    	<AID>A2</AID>
        </A>
    </As>

    I need XPath to get the Actor node whose child AID is having value A1. This XPath should select node A, not AID node.

    I can write XPath to get AID which is having value A1 and I can traverse to A using parentNode.

    But I want to select node A.

  2. #2
    SitePoint Member
    Join Date
    Jun 2007
    Location
    Finland
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    /As/A[AID = 'A1']

  3. #3
    SitePoint Addict ArunB's Avatar
    Join Date
    Jun 2008
    Location
    Hyderabad
    Posts
    252
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah, Fortunately I got it and I am working with it.

    Thank you.


Bookmarks

Posting Permissions

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