ORA-XS-313-C: Comments about the XSLT 2.0 concepts.

SECTION 2: Concepts

The document uses two different paradigms - sequence and tree to
describe the XSLT 2.0 semantics. There are many places where both
paradigms are applied simultaneously to explain various language
constructs.  Such a multi-paradigm approach is internally controversial
if there isn't a well-defined line of separation between them and if
there are no clear procedures how to switch from one paradigm to
another. Of course, a singleton sequence containing a node could be
viewed as a tree as well but such a dualistic approach introduces
redundant complexity to the document and if possible it is better to be
avoided.

Some examples of conceptually controversial descriptions in the
document:
Section 6.3 Applying Template Rules
In the section for <xsl:apply-templates> says that the instruction takes
as input a sequence of nodes from the source tree (actually, it could be
more than one source tree) and produces as output a sequence of items.
Later on it says that the instruction writes to the result tree (?). 

Section 9: Variables and Parameters
In the Variable value definition, value is explicitly said to be a
sequence but later in section 9.4 in the same section it also described
under what conditions the value could be a temporary tree.

Section 11.4.3 Generating Text with xsl:value-of
The description of <xsl:value-of> says that the generated text is
extracted from the source tree or by inserting value of a variable,
which is not exactly true. It is more precise to say that the text is
extracted from the sequence obtained after evaluating the select
expression or from the context item. 

Section 11.8.1 Shallow Copy
<xsl:copy> instruction is described as coping nodes from a source tree
to a result tree, which is incorrect.  It is more consistent with the
document concepts to say that the instruction copies the context item
into the result sequence. 

I believe that the clarity of the document will only benefit if:

-	All of the language construct descriptions use only the sequence
paradigm (except for describing conversion from/to sequence). This
becomes possible if the result-tree creation is viewed as a bottom-up
process (not top-down as is in XSLT 1.0). Source tree & result tree in
Section 1.2 should not be used in the context of individual
instructions.

-	Sequence to tree conversion is performed explicitly by
<xsl:result-document> and implicitly as described in Section 5.6.1
Constructing Complex Content. A new <xsl:result-document> attribute mode
= { append, rewrite, & } can be used to specify precisely how to
construct and serialize the output tree.

-	Tree to sequence conversion is performed when a transformation
is initialized (initial context node) and by document function. 

-	The concept intermediate tree and output state are redundant and
should not be used. The only extra feature the intermediate tree
provides is the implicit document node as a root of the tree. But this
minor obstacle is easily solvable if XSLT 2.0 has an  <xsl:document>
instruction.  



Regards,
Mark Scardina
Oracle Corporation

Received on Monday, 16 February 2004 14:21:04 UTC