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 29822 - [SER31] Adaptive output method, xs:anyURI
Summary: [SER31] Adaptive output method, xs:anyURI
Status: RESOLVED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Serialization 3.1 (show other bugs)
Version: Candidate Recommendation
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: C. M. Sperberg-McQueen
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL: https://www.w3.org/XML/Group/qtspecs/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-14 09:42 UTC by Tim Mills
Modified: 2016-09-23 09:33 UTC (History)
1 user (show)

See Also:


Attachments

Description Tim Mills 2016-09-14 09:42:48 UTC
The specification reads:

"An instance of xs:string or xs:untypedAtomic is serialized by enclosing the value in double quotation marks and doubling any quotes within the value; or optionally by enclosing the value in apostrophes and doubling any apostrophes within the value. The resulting value is then serialized using the Text output method described in 8 Text Output Method."

...

"An atomic value of any other type is serialized using the syntax of a constructor function: xs:TYPE("VAL") where TYPE is the name of the primitive type, and VAL is the result of applying the fn:string() function. For example, xs:date("2015-07-17"). The resulting string is then serialized using the Text output method described in 8 Text Output Method."

xs:anyURI isn't an xs:string, so it is handled by the final rule.  This means

xs:anyURI('"')

will be output as

xs:anyURI(""")

Personally, I'd like to see xs:anyURI be treated just like xs:string and xs:untypedAtomic.
Comment 1 C. M. Sperberg-McQueen 2016-09-20 15:34:56 UTC
If the text says "enclosing the value in double quotation marks and doubling any quotes within the value", surely a URI consisting of a single double-quotation mark would be serialized as 

  xs:anyURI("""")

not as

  xs:anyURI(""")

or am I missing something?
Comment 2 C. M. Sperberg-McQueen 2016-09-20 15:36:24 UTC
Ah.  Sorry for the confusion in comment 1.  I now see what you're saying.
Comment 3 Andrew Coleman 2016-09-23 09:33:46 UTC
At the meeting on 2016-09-20, the WG agreed to handle xs:anyURI the same as xs:string.

This change has been applied to the spec.