Reputation: 945
I have the below document:
<Ships>
<Class name = "Kongo" >
<Ship name "Kongo" launched = "1913" />
<Ship name = "Hiei" launched = "1914"/>
<Ship name = "Haruna" launched = "1915" />
</Class>
<Class name = "North Carolina">
<Ship name = "Washington" launched= "1941"/>
</Class>
</Ships>
I need to find the years in which ships having the same name as their class were launched. Which should be
/Ships/Class/Ship[..]/@launched
the '...' part has been omitted as it should be a condition that specifies where the ship name equals to its class name. Does anyone know how to refer to a higher level element's attribute? The query should return '1913'
Upvotes: 1
Views: 664