Subject: RE: preceding-sibling axis scope
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 16 Apr 2009 13:25:08 +0100
|
Ah, I think I now see your misunderstanding. It's a common one. When you
have a sequence of (unrelated) nodes, such as the sequence returned by
current-group(), the nodes are not siblings of each other. A node has a
single parent, but can participate in any number of sequences; its siblings
are the children of that parent, which may or may not be members of the same
sequence.
Michael Kay
http://www.saxonica.com/
> -----Original Message-----
> From: Clint Redwood [mailto:clint@xxxxxxxxxxxxxxx]
> Sent: 16 April 2009 12:59
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: preceding-sibling axis scope
>
> Hi,
>
> I'm confused by what my XSL is producing, when I'm using the
> preceding-sibling axis, within a xsl:for-each-group element.
>
> When I have a reference like this...
>
> current-group()[preceding-sibling::elemA]
>
> does the preceding-sibling refer to the current-group()
> content, or the source document?
>
> I had expected it to scope to the current-group() but the
> effect appears to suggest that the scope is the source document.
>
> Apologies if this is a stupidly obvious question.
>
> Yours,
>
> Clint.
|