This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
This is a coordination issue between XSLT and XQuery. In XSLT, when an element is copied in the course of constructing its parent element, the base URI of the child element is changed to be the same as its new parent, unless it has an xml:base attribute that overrides this. In XQuery, in the same circumstances, the base URI of the child element remains unchanged. I don't think there is any difference in requirements that justifies this difference in behavior, so we should try to align the specs. I know that both working groups consciously decided to write the specs the way they are - and there are arguments for going either way - but I think we should have another attempt to bring them into line. The argument in favour of not changing the base URI is that this will tend to preserve the meaning of any relative URIs in the content being copied. The argument in favour of changing it is that a tree in which the base URI changes arbitrarily from one element to another, without any visible signal such as an xml:base attribute or an external entity reference, is very difficult for users to understand. There are many other operations (such as serialization) that cause the base URI to change, and if users want to protect themselves they should either absolutize the URIs, or use xml:base. In fact there are many cases where relative URIs are used quite deliberately because the base URI may vary. There are arguments both ways, but there is no good reason for the two specs to be inconsistent.
I think another solution would be to get rid of giving xml:base any special meaning and just treat them as user-provided attributes. 95% of the users do not understand xml:base anyway.
If we ignored xml:base we would soon end up in a position where 100% of users didn't understand it. Perhaps you'd consider that an improvement.
Mike, On May 18, 2005, the Query Working Group discussed your comment and agreed to make the following change to XQuery Section 3.7.1.3, Rule 1-e-ii-E: "When an element or processing instruction node is copied, its base-uri property is set to be the same as that of its new parent, with the following exception: if a copied element node has an xml:base attribute, its base-uri property is set to the value of that attribute, resolved (if it is relative) against the base-uri property of the new parent node. All other properties of the copied nodes are preserved." Since you were a participant in this discussion, I will mark this comment as Fixed and Closed.