Re: [xsl] grouping problem...kinda?

Subject: Re: [xsl] grouping problem...kinda?
From: Florent Georges <lists@xxxxxxxxxxxx>
Date: Sat, 22 Jan 2011 19:04:22 +0000 (GMT)
tom a wrote:

  Hi,

> preceding-sibling::*/@class can return a sequence of
values.
> Why does the copy-of select the correct(/first?) one? 

  The item 9
in the numbered list in "5.7.1 Constructing Complex
Content" in XSLT 2.0 says:
If an attribute A in the result sequence has the same name as
    another
attribute B that appears later in the result sequence,
    then attribute A is
discarded from the result sequence.

  Put another way, it means that if
several attributes with the
same name appear in the sequence, the latest is
picked.  And
because the result of X|Y is always ordered in document order as
per XPath 2.0 (meaning, more or less, in the same order "you see
in the
file"), when you have "preceding-sibling::*/@class|@*" it
will use the
attribute class on the current element, or the
"closest" class attribute on a
preceding sibling.

  Regards,

-- 
Florent Georges
http://fgeorges.org/

Current Thread