xsl-list
[Top] [All Lists]

node-selection

2004-10-29 06:09:24
Hello!
I've got:
<menu>
 <item key="key1" active="0"/>
 <item key="test" active="1">
  <children>
   <item key="test/sub1" active="0"/>
   <item key="test/sub2" active="1"/>
  </children>
 </item>
</menu>

How can I select the key of the last "active" node. If I try 
"//item[(_at_)active=1]@key" both ("test" and "test/sub2") are selected. But I 
only wanted to select "test/sub2".
In the following case "key1" should be selected:
<menu>
 <item key="key1" active="1"/>
 <item key="test" active="0"/>
</menu>

So how can I select the attribute "key" of the "last" item with attribute 
"active" set to "1"?

thanks,

 Stefan


<Prev in Thread] Current Thread [Next in Thread>