[jdom-interest] Reading the xml:base attribute

Bradley S. Huffman hip at a.cs.okstate.edu
Thu Jan 6 10:33:05 PST 2005


"Michael Kay" writes:

> > 
> > You don't. You just have to stop using Namespace.getNamespace(String uri)
> as
> > a "give me a Namespace object with the given URI, and I don't 
> > care what prefix it has", which is not what this method does. 
> 
> But if I stop doing that, how else can I get the attribute with a given
> local name and namespace URI?

Currently, create a Namespace instance that maps a bogus prefix to the URI

    getAttribute(localName, Namespace.getNamespace("bogus", "someuri"));

but since you definitely not a newbie to XML and if this is causing you
confusion, then maybe we should consider adding a getAttribute(localName, URI)
for 1.1.

Brad


More information about the jdom-interest mailing list