General counting question: finding max
Using count() it is easy to count the number of nodes from a certain part of an xmltree. I would like to find the length of the longest chain of <x>'s in the following document: <a><x/<x/></a> <a><x/></a> <a><x/><x/><x/><x/></a> for-each a do count(x)is the easy part. I could save all the counted numbers in a long string and then find the maximum by recursively unpacking the string (as has been demonstrated in this list). However, I have a feeling that there must be an easier way, but I cannot think of it. First task is to only find the length of the longest series, next step is to remember at which <a> that occurred :-) Any help? Gert Bultman Delft Technical University XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format