Re: [xsl] question about identity transform

Subject: Re: [xsl] question about identity transform
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Wed, 01 Nov 2006 18:27:50 -0500
At 05:01 PM 10/31/2006, Dimitre 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.

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

The analogy that occurred to me lately is the "take a number" routine you find in your local Division of Motor Vehicles (or the friendly bureaucracy of your choice if you're not a US resident). Applicants on arrival are given numbers that are then called in order, so while we're waiting around we don't actually have to stand in line.


While we're waiting, we typically fill out the forms that will be required of us.

In XSLT, it's as if the processing happens as we fill out the forms. The re-ordering only has to occur at serialization time.

The number, of course, is called "position()" (which you may note has nothing necessarily to do with how we were ordered when we arrived).

Cheers,
Wendell



======================================================================
Wendell Piez                            mailto:wapiez@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================

Current Thread