Question about XPath expression

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Anna

    #1

    Question about XPath expression

    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
Working...