[jdom-interest] JDOM namespace bug?

Cole, Brian bcole at nsf.gov
Wed Apr 11 15:06:54 PDT 2001

I guess I've been mincing my words, sorry. I should have
wrote "not in any namespace" most or all of the times I
wrote "in the default namespace".

The reason I slipped up is that most XML utilities seem
to take all the tags that don't belong to any namespace
and put them into a default (but not _the_ default) name-
space. (Though there seems not to be a consesus on
this. See
http://www.lists.ic.ac.uk/hypermail/xml-dev/xml-dev-Jan-2000/0140.html )
I was using "default" in this sense. I'll try not to from now on.

Anyway, back to the problem I'm having:
  Tags with the "ej" prefix are not in any namespace,
while tags with no prefix are in the XHTML namespace.
(So XHTML == the default namepspace.)

Here's a sample XML instance file:
<?xml version="1.0" encoding="UTF-8"?>
<ej:baz xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance" xmlns:ej=""
	<ej:foo>1 <b>2 3</b> 4 <b>5</b> 6 <b>7</b> 8 9 10 <b>11</b> 12

  A call to elt.getNamespace().getPrefix() returns the
empty String on both <ej:foo/> and <b/>. I expected
it to return "ej" when called on <ej:foo/>. Please see
my previous post for more detail.


> -----Original Message-----
> From:	Jason Hunter [SMTP:jhunter at collab.net]
> Sent:	Wednesday, April 11, 2001 5:20 PM
> To:	Cole, Brian
> Cc:	'jdom-interest at jdom.org'
> Subject:	Re: [jdom-interest] JDOM namespace bug?
> > Tags with the "ej" prefix are in the default namespace, 
> The default namespace is the namespace with no prefix.  So I don't
> follow you here.
> > and tags with
> > no prefix are in the XHTML namespace. (To put it another way, the
> > null prefix maps to a non-null URI, and the non-null prefix maps to the
> > null URI. There, did that help any, or confuse it further?)
> The Namespace class enforces the spec rule that user-created Namespace
> URIs aren't empty strings, so I don't see how this could work either.
> -jh-

More information about the jdom-interest mailing list