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 query is: <foo:elem xmlns:foo="http://www.example.com/parent"><child xmlns:foo=""/></foo:elem> and the expected result is either err:XQST0085 or: <foo:elem xmlns:foo="http://www.example.com/parent"><child/></foo:elem> As far as I can see, the "child" element ought to have the xmlns:foo="" attribute on it.
I believe that the expected result for this test case is correct. XQuery 1.0 says, in section 3.7.1.2, Namespace Declaration Attributes, that: "If the namespace URI is a zero-length string and the implementation supports [XML Names 1.1], any existing namespace binding for the given prefix is removed from the in-scope namespaces of the constructed element and from the statically known namespaces of the constructor expression." and "A namespace declaration attribute does not cause an attribute node to be created." So I believe that the "child" element does not have an in-scope namespace binding for "foo". Serialization, in section 5.1.7, XML Output Method: the undeclare-prefixes Parameter, says: "The Data Model allows an element node that binds a non-empty prefix to have a child element node that does not bind that same prefix. In Namespaces in XML 1.1 ([XML Names 1.1]), this can be represented accurately by undeclaring prefixes. For the undeclaring prefix of the child element node, if the undeclare-prefixes parameter has the value yes, the output method is XML or XHTML, and the version parameter value is greater than 1.0, the serializer MUST undeclare its namespace. If the undeclare-prefixes parameter has the value no and the output method is XML or XHTML, then the undeclaration of prefixes MUST NOT occur." Finally, XQuery 1.0, in section C.3, Serialization Parameters, says that the value for undeclare-prefixes is "no". Please close this bug report if you agree with this resolution.
I agree with this resolution, but note that XQuery serialization is an optional component which the products I am testing do not currently implement.