Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Question about XPath expression

Reply
Thread Tools

Question about XPath expression

 
 
Anna
Guest
Posts: n/a
 
      11-09-2003
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Seek xpath expression where an attribute name is a regular expression GIMME XML 3 12-29-2008 03:11 PM
C/C++ language proposal: Change the 'case expression' from "integral constant-expression" to "integral expression" Adem C++ 42 11-04-2008 12:39 PM
C/C++ language proposal: Change the 'case expression' from "integral constant-expression" to "integral expression" Adem C Programming 45 11-04-2008 12:39 PM
"Memory leak" in javax.xml.xpath.XPath Marvin_123456 Java 4 07-29-2005 03:49 PM
Problem selecting a node with XPATH if attribute value contains backslashes - how to force XPATH string to be treated as literal? Alastair Cameron XML 1 07-08-2003 07:24 PM



Advertisments