[jdom-interest] Bug and query

Eric VERGNAUD eric.vergnaud at wanadoo.fr
Wed Jun 25 05:27:10 PDT 2003


le 25/06/03 13:01, Rolf Lear à rlear at algorithmics.com a écrit :

> Hate to be the one to inform you, but JDom is correct, and the produced code
> XML exactly represents the XML you asked JDom to create.

I'm glad to be informed, I'm not a member of the "I'm the one who's right"
congregation, to which many programmers seem to belong.

> Creating an Element without a Namespace argument with "new Element
> (tagname)" is exactly equivalent to creating an element as "new Element
> (tagname, Namespace.NO_NAMESPACE)". If you want to put an element into a
> namespace, you have to tell JDom what namespace to use.

Yes this was fine.

> Further, xmlns="" is perfectly valid, and a parser which does not parse it
> is not XML Compliant.

BUT it's useless (isn't it ?). So let's call this a feature request rather
than a bug, even though it ends up with a bug in my situation because the
client parser (a very specialized one, and apparently a pretty bogus one)
does not seem to support empty namespaces.

> Have a look at http://www.w3.org/TR/REC-xml-names/#defaulting and scan down to
> where it says "The default namespace can be set to the empty string. This has
> the same effect, within the scope of the declaration, of there being no
> default namespace."

Thanks very much for this useful link.

Eric




More information about the jdom-interest mailing list