This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
In XQuery, the rules for the base URI of a newly constructed element (3.7.1.3 clause 5b and 3.7.3.1 clause 4b) say: base-uri is taken from the first of the following sources that exists: 1. the value of the constructed node's attribute named xml:base, if this attribute exists; 2. base URI in the static context. This differs from the equivalent rule in XSLT, which is (last paragraph of 11.2): "The base URI of the new element is copied from the base URI of the xsl:element instruction in the stylesheet, unless the content of the new element includes an xml:base attribute, in which case the base URI of the new element is the value of that attribute, resolved (if it is a relative URI) against the base URI of the xsl:element instruction in the stylesheet." I think the XSLT rule is the right one, because it caters for xml:base being a relative URI (which is common, and useful). But I think the rule should also reference XML Base to ensure that the processing of the xml:base attribute is consistent with the rules of that specification. For example, XML Base mandates percent-escaping of special characters. Currently this will be done for a document constructed from an Infoset, but not for a document constructed by a query. Proposed replacement text: base-uri is taken from the base URI in the static context, unless the constructed node has an attribute named xml:base, in which case the base-uri is the value of this attribute, resolved if it is relative against the base URI in the static context. The xml:base attribute is processed as described in [XML Base]: for example, certain special characters are percent-encoded.
With the approval of the Query Working Group, I have made the requested changes. Note that the same rules were affected, in roughly the same way, by Bug 3486. The changes approved by the working group resolve both bugs. Regards, Don Chamberlin (for the Query Working Group)
Closing bug because commenter has not objected to the resolution posted and more than two weeks have passed.