[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] Add numbers


Subject: RE: [xsl] Add numbers
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 9 Oct 2007 17:42:23 +0100

> In your Muenchian grouping condition:
> 	generate-id() = generate-id(key('x', @key)[1]) The [1] 
> is actually redundant, as generate-id() will only take the 
> first node returned. So you can use this:
> 	generate-id() = generate-id(key('x', @key))

I would recommend using the "[1]", because then your code won't throw an
error when the stylesheet is upgraded to version="2.0". Also, I think it's
good generally not to rely on the implicit discarding of items in a sequence
after the first, simply because it makes your code clearer to make it
explicit.

Michael Kay


Current Thread