Apparently, this is a valid XML document (copied from http://www.lenzconsulting.com/namespaces/).
<?xml version="1.1"?>
<my:doc xmlns:my="http://xmlportfolio.com/xmlguild-examples">
<simple xmlns:my="">
<remark>We don't use namespaces.</remark>
</simple>
</my:doc>
And yet it appears to violate the "Prefix Declared" namespace constraint in the Namespace 1.1 spec.
Namespace constraint: Prefix Declared
The namespace prefix, unless it is xml or xmlns, must have been declared in a namespace declaration attribute in either the start-tag of the element where the prefix is used or in an ancestor element (i.e. an element in whose content the prefixed markup occurs). Furthermore, the attribute value in the innermost such declaration must not be an empty string.
Notice the last sentence 'the attribute value in the innermost such declaration must not be an empty string' and how it applies to the my:
undeclaration in the simple
element of the document above. Surely this is the innermost such declaration?
My reading of this, is that you cannot undeclare a prefix, unless you have a child element which re-declares it.
Yes, it is valid (technically, "namespace-well-formed") according to Namespaces 1.1
The rule you cite is referring to the validity of element and attribute names such as my:element or my:attribute, and it's a rule concerning the validity of the prefix "my" in such a name. You don't have any element or attribute with the prefix "my" for which the namespace declaration xmlns:my is the innermost declaration, so you haven't violated the rule.
There's very little value in undeclaration. It was a big mistake: a painful addition to the spec to solve a tiny problem. The tiny problem was "namespace pollution": if you wrap some XML payload inside a SOAP envelope, for example, then the SOAP namespaces permeate your payload, and when you extract the payload, it's hard to get rid of the SOAP namespaces. Namespace declaration was intended to be a solution to that problem; but it's hardly ever used, because in practice, everyone ignores unnecessary unused namespaces.