[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

General counting question: finding max

Subject: General counting question: finding max
From: Gert Bultman <g.w.bultman@xxxxxxxxxxxxxx>
Date: Tue, 15 Aug 2000 11:55:21 +0000
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.