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

Re: Re: Counting Nodes

Subject: Re: Re: Counting Nodes
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Mon, 26 Nov 2001 21:07:57 -0800 (PST)
counting node
> > So, do as you said:
> > count(//node()|//@*)
> 
> I'm curious. Apart from the present case (evaluating processors),
> why might one need to count the total number of nodes in an XML
> document (excluding inquisitiveness)?

1. In case you've decided to use the Wendell Piez non-recursive repetition method
you might want to be sure there are enough nodes. Then you'll evaluate:

count(//node() | //@* | //namespace::*)

2. In case you're seeking a ***permanent*** ID scheme for any node -- then you'll
have to traverse the nodes from the above union. If you chose to use their position
in this nodelist, then the count will give you a base to calculate the minimum
necessary length in bytes of the node ID.

Cheers,
Dimitre Novatchev.


__________________________________________________
Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1

 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.