xsl-list
[Top] [All Lists]

Re: [xsl] question about identity transform

2006-10-31 16:20:56
I think this has been discussed quite often in this list and should
probably be well-reflected in the FAQ.

A node-set is a set.

A set, by definition, is unordered.

Therefore, it doesn't matter whether an XPath expression is written as:

 A | B

or

B | A


the result is the same set.


--
Cheers,
Dimitre Novatchev
---------------------------------------
Truly great madness cannot be achieved without significant intelligence.
---------------------------------------
To invent, you need a good imagination and a pile of junk
-------------------------------------
You've achieved success in your field when you don't know whether what
you're doing is work or play




On 10/31/06, Abel Braaksma <abel(_dot_)online(_at_)xs4all(_dot_)nl> wrote:
Dimitre Novatchev wrote:
>> If you would refers it, and make it, say: ` node ( ) | @* ' the nodes
>> would first be copied, resulting in the attributes ending up illegally:
>> you may not create an attribute node after you create an element node in
>> the result tree. However, I'm not sure if this is really enforced by the
>> specs.
>
>
> This is not true.
>
> The order in which an <xsl:apply-templates> instruction is applied on
> the nodes selected by the expression as specified in its select
> attribute is not defined and may be in any order.

Thanks for pointing that out. Indeed, I always forget about this
processing order, and tend to think in terms of result tree order...

>
> What is important, is that the results of these applications are
> combined/ordered based on the document order of the processed nodes.

I see. Meaning that though it can be processes in any order, the actual
order of the output is determined by a certain set of rules, which is
based on the original document order and not the order of the xpath in
the template or the template itself. And I was always so careful putting
the right order for the " | " unioned items ;-)

-- Abel

--~------------------------------------------------------------------
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>
--~--



--~------------------------------------------------------------------
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>
--~--