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 3416 - [XQuery] Base URI of a constructed element
Summary: [XQuery] Base URI of a constructed element
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 1.0 (show other bugs)
Version: Candidate Recommendation
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: Don Chamberlin
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-30 11:17 UTC by Michael Kay
Modified: 2007-02-25 23:50 UTC (History)
0 users

See Also:


Attachments

Description Michael Kay 2006-06-30 11:17:57 UTC
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.
Comment 1 Don Chamberlin 2006-09-13 23:49:41 UTC
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)
Comment 2 Jim Melton 2007-02-25 23:50:06 UTC
Closing bug because commenter has not objected to the resolution posted and more than two weeks have passed.