xsl-list
[Top] [All Lists]

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

2011-01-22 13:04:34
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/




      

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>