This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
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.
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?
Ah. Sorry for the confusion in comment 1. I now see what you're saying.
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.