xsl-list
[Top] [All Lists]

RE: [xsl] One-based indexes in XPath

2008-05-22 08:58:38
Suspicion incorrect Wendel.

I'm agnostic re 1-ness or 0-ness.  Just that it is a royal pain to have two
different systems and it is no more awkward to type p[1] or p[0].
Of course, as someone else pointed out, p[n] is short for p[position()=n]
and so to have 0-ness would impact upon last() and similarly related XPath
functions.

For the "kids" I prefer the teaching of arithmetic tables as follows:

     1  2  3  4  5  6  7  8  9
 10 11 12 13 14 15 16 17 18 19
 20 21 ...

leaving the first cell blank (or with the digit 0)

so as to make for better pattern recognition, for young brains, in a
decimal, or whatever base, system.

This debate has brought a lot of healthy traffic; pro's and con's; one god
or two; zero (gods) is definitely defamed by this list :-)

What is important, though, is that we do have an recognized standard (aka
recommendation), namely the XPath 2 Data Model (XDM).
(To my knowledge, XPath 1 lacked the rigorousness of an XDM).

Further, in the absence of any serious efforts elsewhere for
standardization, we, as members of this list, should advocate for the wider
adoption of the XDM beyond XPath in just XSLT or XQuery.

Given a few more years, it is quite possible that XPath 2 and the XDM will
find its way into areas that the (W3C) designers would never have imagined.

Just imagine the joy if all mainstream programming languages shared XDM as
the lowest common denominator.

Is this but a wish or something that we can aspire to in our generation?

Bests to all on this fine list,
Justin Johansson

--------------------------------------------------------------
Why should I care about future generations;
 what have future generations ever done for me?
Attrib: Groucho Marx
--------------------------------------------------------------

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" 

<cut/>

I agree that XSLT made the right decision, while I admit that it's 
sometimes awkward.

And I suspect that Justin agrees that if XSLT's designers had 
designed it so as to avoid any offense to Javascript programmers (or 
to callow youth of any persuasion), it would probably be even more 
awkward than it is.

Cheers,
Wendell



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>