Subject:xpath: how do I get what I want? Author:Christian Gutermann Date:06 Mar 2007 02:44 PM
Hello!
Maybe this is a stupid question ...
if I define a query like that
/gnr_liste/gnr/kv/kv_bewertung_liste/kv_bewertung/*
I get all attributes of nodes behind "kv_bewertung". But how can I get the attributes of "gnr" in the same query output?
Subject:xpath: how do I get what I want? Author:Tony Lavinio Date:06 Mar 2007 11:10 PM
If your context is the node below
/gnr_liste/gnr/kv/kv_bewertung_liste/kv_bewertung/
then this (if I've counted correctly) should return
the attributes of the gnr above it in the path.
../../../../@*
Subject:xpath: how do I get what I want? Author:Christian Gutermann Date:07 Mar 2007 02:08 PM
Thank you Ivan!
Your answer helped a lot! Now I understand much better how XPath works. But I still have problems in selecting attributes: i.e.: if an element has 4 attributes and I need only 2 of them, how can I select them?