[jdom-interest] Possible bug in SAXHandler when "namespaces" feature is off

Jason Hunter jhunter at servlets.com
Mon Jan 19 16:40:58 PST 2004

Dmitri Plotnikov wrote:

> I have an issue with the statement that JDOM supports XML without namespaces
> if it always treats a colon in a special way.  Here's a quote from the XML
> specification:
> [Definition: A Name is a token beginning with a letter or one of a few
> punctuation characters, and continuing with letters, digits, hyphens,
> underscores, colons, or full stops, together known as name characters.]
> Later the spec says:
> XML processors must accept the colon as a name character.

Yep, we don't.  It proved too dangerous for users.  They were shooting 
themselves in the foot left and right.  JDOM supports code gun control. 
  :-)  If you want colons, it's a trivial change in the Verifier.

> Not that this is a problem for JDOM, but DOM indeed follows this
> recommendation. When the namespaces feature is off, colons are treated as
> legitimate characters of a name, just like "A" and "_".  I believe the idea
> of namespaces=false is not to bark when there is a colon in a name, but to
> treat it as a legitimate and ordinary name character.

We could do something like that.  So long as by default users weren't 
able to do the Tempting but Wrong Thing.

> But, like I said earlier, I no longer think that JDOM needs to address this
> issue in any way other than explicit documentation and perhaps a quick check
> that the XMLParser passed to it has the namespaces feature enabled.

That's my plan.


More information about the jdom-interest mailing list