xml - XPath - Select LAST occurence of String -


i've got tree:

<events>  <properties>    <property descriptor=100>1378314022</property>    <property descriptor=200>abc1234</property>  </properties>  <properties>    <property descriptor=100>1378314023</property>    <property descriptor=200>abc1234</property>  </properties>  <properties>    <property descriptor=100>1378314024</property>    <property descriptor=200>abc1234</property>  </properties>  <properties>    <property descriptor=100>1378314022</property>    <property descriptor=200>123456</property>  </properties>  <properties>    <property descriptor=100>1378314023</property>    <property descriptor=200>123456</property>  </properties>  <properties>    <property descriptor=100>1378314024</property>    <property descriptor=200>123456</property>  </properties>  </events> 

how can select <descriptor=200> values no duplicates? example in case need select abc1234 , 123456 once.

update: need iterate @ events level , select distinct strings.

do want last, or no duplicated values?

for no duplicated values:

distinct-values(//property[@descriptor=200]) 

for last

(//property[@descriptor=200])[last()] 

(assuming descriptor property, , lost <property beginning when posting xml, since file posted not valid xml)


Comments

Popular posts from this blog

c# - Unity IoC Lifetime per HttpRequest for UserStore -

Change the color of an oval at click in Java AWT -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -