Subject: Re: [xsl] One-based indexes in XPath From: Justin Johansson <procode@xxxxxxxxxxx> Date: Wed, 21 May 2008 04:00:37 +0900 |
Seems to me that the historical argument for 1 as opposed to a 0 based index is a good one. Just like tobacco and alcohol, being rather addictive substances, would otherwise be on a government perscription-only list if they were invented today. However, my original question remains true to XSL List agenda. Say we contrive some xsl like this (sure script is somewhat frowned upon in XSLT) := <xsl:variable name="ns" select="thingy"/> <xsl:variable name="nslen" select="count( $ns)"/> <xslex:script> for ( var i = 0; i < $nslen; ++i) { do_something_with( $ns, i); } </xslex:script> Going from XSL-world to a non-XSL-script (extension library) world can cause confusion with 0 or 1 based indexes. Would it be better to design an XSL extension library (implemented in say Javascript) to have a 1-based index for parameter calling conventions into that library rather than a 0-based index which has more of the feel fot the native/external scripting language? Justin Johansson
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] One-based indexes in XPat, Michael Ludwig | Thread | Re: [xsl] One-based indexes in XPat, Justin Johansson |
Re: [xsl] One-based indexes in XPat, Colin Adams | Date | Re: [xsl] One-based indexes in XPat, Andrew Welch |
Month |