Question about XPath expression

A

Anna

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top