This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 3655 - [FS] specification of item-sequence-to-* functions unclear
Summary: [FS] specification of item-sequence-to-* functions unclear
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Formal Semantics 1.0 (show other bugs)
Version: Candidate Recommendation
Hardware: All All
: P2 minor
Target Milestone: ---
Assignee: Michael Dyck
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-05 14:28 UTC by Oliver Hallam
Modified: 2009-06-22 19:52 UTC (History)
0 users

See Also:


Attachments

Description Oliver Hallam 2006-09-05 14:28:10 UTC
The descriptions of the following functions in the formal semantics specification are unclear:

fs:item-sequence-to-node-sequence
fs:item-sequence-to-node-sequence-doc
fs:item-sequence-to-untypedAtomic
fs:item-sequence-to-untypedAtomic-PI
fs:item-sequence-to-untypedAtomic-text
fs:item-sequence-to-untypedAtomic-comment

For fs:item-sequence-to-node-sequence the description says:

The fs:item-sequence-to-node-sequence function converts a sequence of item values to nodes by applying the normative rules numbered 1, 2, 3 after the sentence "Processing of the computed element constructor proceeds as follows:" in Section 3.7.3.1 Computed Element ConstructorsXQ.

These rules should be applied to the content expression, not the sequence of items, and so this should read:

The fs:item-sequence-to-node-sequence function converts a sequence of item values to nodes by applying the normative rules numbered 1, 2, 3 after the sentence "Processing of the computed element constructor proceeds as follows:" in Section 3.7.3.1 Computed Element ConstructorsXQ for processing the content expression.


Similarly, for fs:item-sequence-to-node-sequence-doc the description says:

The fs:item-sequence-to-node-sequence function converts a sequence of item values to nodes by applying the normative rules numbered 1, 2, 3 after the sentence "Processing of the computed element constructor proceeds as follows:" in Section 3.7.3.1 Computed Element ConstructorsXQ.

This should read:

The fs:item-sequence-to-node-sequence function converts a sequence of item values to nodes by applying the normative rules numbered 1, 2, 3 after the sentence "Processing of the computed element constructor proceeds as follows:" in Section 3.7.3.1 Computed Element ConstructorsXQ for processing the content expression.


When reading the specification for the other functions listed, as well as these suggested changes it is still very easy to miss "for processing the content expression", and so the behaviour for non-node items is unclear.  It might be a lot clearer if the words "content expression" linked to a brief section describing the content expression.
Comment 1 Oliver Hallam 2006-09-05 15:14:13 UTC
> These rules should be applied to the content expression, not the sequence of
> items, and so this should read:

It seems I had my terminoligy confused - where I had said "content expression", I meant "content sequence".

The following sentence is from section 3.7.1.3 of the XQuery 1.0 spec (just above the sentence referred in the description of item-sequence-to-node-sequence:

The content expression of a computed element constructor (if present) is processed in exactly the same way as an enclosed expression in the content of a direct element constructor, as described in Step 1e of 3.7.1.3 Content.  The result of processing the content expression is a sequence of nodes called the content sequence. If the content expression is absent, the content sequence is an empty sequence.

It is this bit of processing that is not mentioned at all in any of the function descriptions, and also was the source of my confusion.  Perhaps this should be repeated in the formal semantics spec and made more obvious in the descriptions of the aforementioned functions
Comment 2 Jerome Simeon 2006-09-19 14:47:39 UTC
Those are good suggestion to align the text with the corresponding part in the language books. I believe those proposed changes do not change the normative part of the text.
- Jerome
Comment 3 Jerome Simeon 2006-09-26 13:56:45 UTC
Olivier,
The XSLT and XML Query Working groups have adopted your proposal and
will make the corresponding changes in the next version of the formal
semantics documents.
This comment is considered as editorial.
Best regards,
- Jerome Simeon
on behalf of the XSLT and XML Query WGs
Comment 4 Michael Dyck 2006-10-05 20:29:25 UTC
(In reply to comment #1)
> 
> The following sentence is from section 3.7.1.3 of the XQuery 1.0 spec

It's actually from section 3.7.3.1, and refers to section 3.7.1.3.

> It is this bit of processing that is not mentioned at all in any of the
> function descriptions, and also was the source of my confusion.  Perhaps this
> should be repeated in the formal semantics spec and made more obvious in the
> descriptions of the aforementioned functions

Note that that bit of processing is only relevant for
  fs:item-sequence-to-node-sequence and
  fs:item-sequence-to-node-sequence-doc.

Please clarify the effect of this issue on the other functions.
Comment 5 Jim Melton 2007-02-26 00:15:06 UTC
The fix for this bug does not appear in the Recommendation of 23 January 2007. 
It will be considered for a future publication (either an Errata document or
some possible future version of the specification). 
Comment 6 Michael Dyck 2008-08-22 23:30:28 UTC
The fix for FS erratum E029 (see also Bug 3771) modifies the semantics of
fs:item-sequence-to-node-sequence and changes its description to:

    The fs:item-sequence-to-node-sequence function converts a sequence
    of item values to nodes by applying the normative rules numbered
    1e and 2 in Section 3.7.1.3 Content [XQ] (with the value bound to
    $items playing the role of "the value of an enclosed expression").

Also, the new semantics for fs:item-sequence-to-node-sequence render
fs:item-sequence-to-node-sequence-doc redundant, so it has been removed.

I believe these changes resolve the remaining issues in this bug, so I'm
marking it resolved-FIXED. If you agree, please mark it CLOSED.
Comment 7 Michael Dyck 2009-06-22 19:52:50 UTC
The fixes for this issue appear in the Proposed Edited Recommendation
for the FS.  After 10 months with no response from the original reporter,
I am marking this issue CLOSED.