[Bug 29442] [XSLT30] Impossible to return maps, functions, arrays, sequence of integers or doubles from xsl:functions, xsl:templates, xsl:sequence etc

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

--- Comment #2 from Abel Braaksma <abel.braaksma@xs4all.nl> ---
Thanks, I knew I was missing the obvious and I think I have been stymied by
this before.

In section 5.7 there are only two sections on constructing content, either
simple or complex. The section on complex mentions an open-ended list: "...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."

This led me to believe that this list is anything that is not in the
all-inclusive list mentioned under Simple Content.

I see now that somewhat hidden in the preamble of this section there's a line
that simply says: 

"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."

Which, in hindsight, is probably the crux I was missing upon reading and
re-reading.

Another caveat that led me into circles was:

"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...."

the offending part being "may be", which I (again, in hindsight) read as "it
may be used for creating nodes, but this section describes how you evaluate
it".

Finally, in the list of instructions that create complex content, also xsl:copy
is mentioned. I think this is true (the only hierarchical data types are
elements and document nodes, for which the seqtor is evaluated), so even when
the seqtor of xsl:copy returns a function item, it can only ever become a child
of a node (error!) or it is never evaluated (not an error).

I would like to suggest a few minor tweaks to the text to make it clear(er),
perhaps we can discuss it briefly at the F2F. Suggestion like:

- make the list of instructions that trigger complex content a complete list
- add the "hidden" line of the preamble in its own section, say "processing
sequence constructors" and again create a complete list, or make explicit that
this is "anything but the instructions mentioned under Complex/Simple.
- make explicit, or add a note, that if Complex/Simple is not in effect,
normalization does NOT take place and text nodes, even empty ones, are not
concatenated, nor removed.
- some variant of the above

(though I am glad the bug appeared not to be the bug I thought it was...)

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

Received on Tuesday, 9 February 2016 21:41:52 UTC