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 5985 - [XQuery 1.1] converting a sequence into a string
Summary: [XQuery 1.1] converting a sequence into a string
Status: RESOLVED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 3.0 (show other bugs)
Version: Working drafts
Hardware: All All
: P2 minor
Target Milestone: ---
Assignee: Jonathan Robie
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords: needsDrafting
Depends on:
Blocks:
 
Reported: 2008-08-24 02:24 UTC by Michael Dyck
Modified: 2009-11-05 18:39 UTC (History)
2 users (show)

See Also:


Attachments

Description Michael Dyck 2008-08-24 02:24:10 UTC
Four sections in the XQuery 1.0 spec:
    3.7.1.1 Attributes
    3.7.3.2 Computed Attribute Constructors
    3.7.3.5 Computed Processing Instruction Constructors
    3.7.3.6 Computed Comment Constructors
have substantially the same chunk of text, for converting an XDM sequence
into a string value:

   1.  Atomization is applied to the [input], converting it to a
       sequence of atomic values.
   2.  If the result of atomization is an empty sequence, the [output]
       is the zero-length string. Otherwise, each atomic value in the
       atomized sequence is cast into a string.
   3.  The individual strings resulting from the previous step are merged
       into a single string by concatenating them with a single space
       character between each pair. The resulting string [is the output].

Could these be abstracted into a single concept/process for 1.1?
Comment 1 Michael Kay 2008-08-24 21:28:07 UTC
For information, XSLT 2.0 collects these up into a a single procedure described at

http://www.w3.org/TR/xslt20/#constructing-simple-content
 
The XSLT procedure is slightly different from the XQuery procedure, in that it discards zero-length text nodes and merges adjacent text nodes before atomizing. This is largely to ensure that XSLT 2.0 behaves in the same way as 1.0.

Comment 2 Jonathan Robie 2008-11-03 21:27:31 UTC
This would absolutely be an improvement.
Comment 3 Jonathan Robie 2009-11-05 18:39:58 UTC
The WG decided to leave this to the discretion of the editor. This change is purely editorial.