top id from xml
Clever little XPath 1.0, gets the node with the highest id value. Xpath 2.0 has the max() function that ultimately does the same thing.
/rt/item[@id[not(. < ../../item/@id)]]
<rt>
</rt>
returns
<item id="5">txt
by Miguel de Melo
Clever little XPath 1.0, gets the node with the highest id value. Xpath 2.0 has the max() function that ultimately does the same thing.
/rt/item[@id[not(. < ../../item/@id)]]
<rt>
</rt>
returns
<item id="5">txt
Posted by Miguel de Melo at 15:01
Labels: xslt xml xpath
I have been working with many web technologies in the past 12 years but my favourite by far is XSLT. I just started a Google Group about XSLT in Portuguese, my native tongue, XSLT Portugal.
I am obsessed with photography, I just love to take as many photos as I can on my Canon EOS 30D and then just play with them in Photoshop. If you have a chance have a quick pick at me flickr account.
Subscribe to XSLT Portugal |
Visit this group |
No comments:
Post a Comment