[jdom-interest] JDOM, Xerces and Crimson with namepsaces
Eric A. Sirois
easirois at hotmail.com
Wed Nov 28 10:24:13 PST 2001
Hello,
In your example the root element belongs to the "ns1" namespace, not the no namespace. If you want to have the root element to belong to the no namespace it cannot have a xmlns attribute declaration.
XML Namespace rec:
<!-- snip -->
5.1 Namespace Scoping
The namespace declaration is considered to apply to the element where it is specified and to all elements within the content of that element, unless overridden by another namespace declaration with the same NSAttName part
Multiple namespace prefixes can be declared as attributes of a single element
5.2 Namespace Defaulting
A default namespace is considered to apply to the element where it is declared (if that element has no namespace prefix), and to all elements with no prefix within the content of that element. If the URI reference in a default namespace declaration is empty, then unprefixed elements in the scope of the declaration are not considered to be in any namespace. Note that default namespaces do not apply directly to attributes.
<!-- snip -->
More information about the jdom-interest
mailing list