[Bug 29442] [XSLT30] Some tweaks may be needed on 5.7 Sequence Constructors to create a better understanding between the two phases involved and the effect of build-tree

https://www.w3.org/Bugs/Public/show_bug.cgi?id=29442

--- Comment #7 from Michael Kay <mike@saxonica.com> ---
Proposed changes:

(a) change

The result of evaluating a sequence constructor is the sequence of items formed
by concatenating the results of evaluating each of the nodes in the sequence
constructor, retaining order.

to

[Definition: The result of evaluating a sequence constructor -- referred to as
the *raw result* of the sequence constructor -- is the sequence of items formed
by concatenating the results of evaluating each of the nodes in the sequence
constructor, retaining order.]

(b) change

"There are several ways the result of a sequence constructor may be used."

to

"The way that raw result of a sequence constructor is used depends on the
containing element in the stylesheet, and is specified in the rules for that
element. It is typically one of the following:"

(b) rewrite the first bullet and the subsequent Note as follows:

* The raw sequence may be bound to a variable or delivered as the result of a
stylesheet function. In this case the "as" attribute of the containing variable
or function may be used to declare its required type, and the *raw result* is
then converted to the required type by applying the *function conversion
rules*.

Note:

* In the absence of an "as" attribute, the result of a function is the raw
sequence; but the value of a variable (for backwards compatibility reasons) is
a document node whose content is formed by applying the rules for *Constructing
Complex Content* to the raw sequence.

* The function conversion rules do not merge adjacent text nodes or insert
separators between adjacent items. This means it is often inappropriate to use
xsl:value-of in the body of xsl:variable or xsl:function, especially when the
intent is to return an atomic result. The xsl:sequence instruction is designed
for this purpose, and is usually a better choice.

* The result of a function, or the value of a variable, may contain nodes (such
as elements, attributes, and text nodes) that are not attached to any parent
node in a result tree.  The semantics of XPath expressions when applied to
parentless nodes are well-defined; however, such expressions should be used
with care. For example, the expression / causes a type error if the root of the
tree containing the context node is not a document node.

* Parentless attribute nodes require particular care because they have no
namespace nodes associated with them. A parentless attribute node is not
permitted to contain namespace-sensitive content (for example, a QName or an
XPath expression) because there is no information enabling the prefix to be
resolved to a namespace URI. Parentless attributes can be useful in an
application (for example, they provide an alternative to the use of attribute
sets: see 10.2 Named Attribute Sets) but they need to be handled with care.


(c) change the introductory paragraph of "Constructing Complex Content" from

This section describes how the sequence obtained by evaluating a sequence
constructor may be used to construct the children of a newly constructed
document node, or the children, attributes and namespaces of a newly
constructed element node. The sequence of items may be obtained by evaluating
the sequence constructor contained in an instruction such as xsl:copy,
xsl:element, xsl:document, xsl:result-document, or a literal result element.

to

Many instructions, for example xsl:copy, xsl:element, xsl:document,
xsl;result-document, and literal result elements, create a new parent node, and
evaluate a sequence constructor forming the content of the instruction to
create the attributes, namespaces, and children of the new parent node. The raw
result of the sequence constructor is processed to create the content of the
new parent node as described in this section.

(d) Use the new term "raw result" elsewhere where it aids understanding.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Tuesday, 23 February 2016 22:26:14 UTC