This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Re: Counting Nodes


> > 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]