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
Post a Comment