Question about XPath expression

Discussion in 'XML' started by Anna, Nov 9, 2003.

  1. Anna

    Anna Guest

    Hi all. I hav eproblems constructing one XPath expression.
    Here is what I want to do:
    I want to choose all area tags that belong to a certain image map,
    having src of the image map.
    I don't want to use map name for this check, but src of the image map.
    In other words, I want to say something like this:
    "Choose all area tags for which src of image with usemap attribute
    that equals '#+name attribute of parent map of the above area' equals
    given value".

    So I construct an XPath:
    //area[ancestor::body/descendant::img[@usemap=concat('#',
    parent::map/@name)]/@src = $GIVEN_VALUE]

    This XPath doesn't work, because when it comes to the expression
    parent::map,
    it is already looking at the image, not at the area.
    I can't use current()/parent::map expression.

    Is there an elegant way to say the above as pure XPath expression?

    Hope this is not very messy.
    I will be glad to give more explanation about my problem if necessary.

    Thank you very much for help.

    Anna
    Anna, Nov 9, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Marvin_123456

    "Memory leak" in javax.xml.xpath.XPath

    Marvin_123456, Jul 29, 2005, in forum: Java
    Replies:
    4
    Views:
    1,963
    jan V
    Jul 29, 2005
  2. Alastair Cameron
    Replies:
    1
    Views:
    7,390
    SQL Server Development Team [MSFT]
    Jul 8, 2003
  3. Anna
    Replies:
    0
    Views:
    514
  4. goog
    Replies:
    0
    Views:
    503
  5. GIMME
    Replies:
    3
    Views:
    11,939
    vforvikash
    Dec 29, 2008
Loading...

Share This Page