[Bug 5316] [UPD] Rename: default namespace for attributes

http://www.w3.org/Bugs/Public/show_bug.cgi?id=5316


chamberl@almaden.ibm.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED




------- Comment #3 from chamberl@almaden.ibm.com  2008-01-14 23:10 -------
The resolution of this bug should work for renaming PI's as well as attributes.
I suggest that we revise Section 2.4.4 (Rename) by replacing Rules 2 and 3 with
the following combined rule:

2. NewNameExpr must be a non-updating expression; otherwise a static error is
raised [err:XUST0001]. NewNameExpr is processed as follows:

a. If $target is an element node, let $QName be the result of evaluating
NewNameExpr as though it were the name expression of a computed element
constructor [XQuery Section 3.7.3.1]. If the namespace binding of $QName
conflicts with any namespace binding in the "namespaces" property of $target, a
dynamic error is raised [err:XUDY0023].

b. If $target is an attribute node, let $QName be the result of evaluating
NewNameExpr as though it were the name expression of a computed attribute
constructor [XQuery Section 3.7.3.2]. If the namespace binding of $QName
conflicts with any namespace binding in the "namespaces" property of the parent
(if any) of $target, a dynamic error is raised [err:XUDY0023].

c. If $target is a processing instruction node, let $NCName be the result of
evaluating NewNameExpr as though it were the name expression of a computed
processing instruction constructor [XQuery Section 3.7.3.5], and let $QName be
defined as fn:QName((), $NCName).  

In addition to the above replacement, Rule 4 becomes Rule 3 and error code
XUDY0025 is eliminated.

Cheers,
--Don Chamberlin

Received on Monday, 14 January 2008 23:10:49 UTC