XPATH - Select all child nodes with a specific attribute

Posted by David on Stack Overflow See other posts from Stack Overflow or by David
Published on 2010-03-21T17:43:03Z Indexed on 2010/03/21 18:11 UTC
Read the original article Hit count: 384

Filed under:
|
|
|

Hi, what would be the xpath for the following:

Find all child nodes with a specific attibute value but starting from a node with a specific attribute value.

This is kind of related to a question I posted earlier about parsing and rdf xml file - I thought I had solved it but not quite yet.

For example I am trying to parse and grab all of the rdf:about attribute values. I have this working fine. I need to add the following condition though - parsing needs to start after a specific rdf:about value is found.

I am working in php and and using DomDocument and am using the following xpath query: $xpath->query('//@rdf:about') - it is finding all rdf:about attributes fine.

I need to extend this to only find thos attributes that come after the node who rdf:about attribute is equal to something.

Hope this makes sense.

© Stack Overflow or respective owner

Related posts about xpath

Related posts about php