From: Trevor Nash <tcn@me...>  20030416 10:19:22

These specs are hard to follow aren't they? After a bit of searching: 14.2.4 confirms that indexes are 1based. I hope it says that in the data model too. 14.2.9 says: "The value returned by the function consists of all items of $target whose index is less than or equal to N, followed by all items of $inserts, followed by the remaining elements of $target, in that sequence." So if N is 5 you get the first five elements then the thing to insert. In other words I think this is doing something which is counter to most peoples intuition: its inserting *after* the given position, rather than inserting *before* the given position. Which makes position zero necessary but kind of hard to explain. I do not understand why they also say: "If N is less than zero (0), the effective value of N is zero (0). If N is greater than the number of items in $target, then the effective value of N is equal to the number of items in $target plus 1." This is redundant given the sentence I quoted first. I think we should resurrect XSLT1.1 before our brains end up in a puddle on the floor... how many volumes is the new book, Mike? Best regards, Trevor Nash On Wed, 16 Apr 2003 09:26:44 +0100, David wrote: ><xsl:variable name=3D"targetseq" select=3D"(1,2,3,4,7)"/> ><xsl:variable name=3D"whattoinsert" select=3D"(5,6)"/> ><xsl:variable name=3D"position" select=3D"5"/> > ><xsl:variable name=3D"result" select=3D"insert($targetseq, $position, >$whattoinsert)"/> > >(<xsl:valueof select=3D"$result" separator=3D", "/>) > > >gives: (1, 2, 3, 4, 7, 5, 6)=20 > ><xsl:variable name=3D"result" select=3D"insert($targetseq, 1, >$whattoinsert)"/> >gives >(1, 5, 6, 2, 3, 4, 7)=20 > >which is right if sequences number from zero..... >I had it they numbered from 1. >Unless I'm wrong yet again? >Nil in 14.2.9 about zero or 1 based numbering. Melvaig Software Engineering Limited voice: +44 (0) 1445 771 271=20 email: tcn@... web: http://www.melvaig.co.uk 