RE: One-based indexes in XPath
Dijkstra wrote a note "Why numbering should start at zero": <http://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html>
This is great. Especially the confession that this most "natural" rational argument was spurred in reaction to to an emotional outburst by a person who had supposed that a reasonable, considered decision to number from zero, then applied out of habit (probably in a context outside the proper scope of the numbering system, although we aren't told this), to be "pedantry", and therefore, by implication, to be motivated by something other than reason.
What the argument doesn't consider is that the habit of counting from zero might have been both reasonable and pedantic, since motivations need not be exclusive of one another (much as this might bother reasonable people). The argument is made that zero-based numbering is convenient and reasonable, but it does not demonstrate that the charge of pedantry was unjust.
I agree that XSLT made the right decision, while I admit that it's sometimes awkward.
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