[jdom-interest] Reading the xml:base attribute
Jason Hunter
jhunter at xquery.com
Mon Jan 10 17:00:28 PST 2005
Michael Kay wrote:
> Suggestion: Namespace.getNamespace(uri) when the uri is the XML namespace
> should not fail, but should return Namespace.XML_NAMESPACE.
I don't see a big downside with this approach. We just document that
for the special case of any URIs which by spec fiat cannot be the
default namespace, we return their special namespace. Right now that's
only the XML namespace. The spec made it a special case (don't see why
that was necessary) so it's prob best if we follow along.
> Incidentally, I assume the prefix in the Namespace object makes no
> difference to the results of getAttribute(), but the documentation doesn't
> make this clear.
Correct. We can enhance the docs.
> Also, I've always assumed that Namespace.getNamespace("") returns the
> non-namespace, and indeed (looking at the source code) it does, but I now
> see that there's nothing in the documentation to justify this assumption.
We can also document that more. I wish the namespace spec had given a
real name to the thing you call the non-namespace.
Thanks for the suggestions,
-jh-
More information about the jdom-interest
mailing list