[From nobody Fri Aug 6 17:05:26 2004 X-Mozilla-Status2: 00000000 Message-ID: <3A3E8F0A.F635BA44@collab.net> Date: Mon, 18 Dec 2000 14:26:18 -0800 From: Jason Hunter <jhunter@collab.net> X-Mailer: Mozilla 4.75 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 To: Elliotte Rusty Harold <elharo@metalab.unc.edu> CC: JDOM Interest <jdom-interest@jdom.org> Subject: Re: [jdom-interest] Additional namespace issues References: <3A39AED6.E7D8D911@collab.net> <p04330101b65fdd4af532@[192.168.1.6]> <3A3A6A74.7AB28278@collab.net> <p04330100b663c19bfd77@[192.168.1.6]> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit > I'm sorry. I must have been asleep. What I asked for is not what I > wanted at all, and I agree it makes no sense. What I should have > asked for, and what had been asked for before, were methods like this: > > public Namespace getNamespace(String prefix) > > In other words, when I encounter a namespace prefix in an attribute > value as happens in XSLT, Schemas, and probably elsewhere I can ask > what that prefix is mapped to in the context of the current element. I'm a little confused here. The "I" in "I encounter": is that you as a user or as a builder? I can see builders needing to map a prefix to a URI (although the current namespace stack works OK too). I'm not sure where a user might need that functionality tho. Attribute objects already have getNamespacePrefix() and getNamespaceURI(). ??? > This may moving up the tree, though often not all the way to the > root. I should also have a method like this: Yep, it'd walk up the tree looking for the nearest prefix hit. > public Namespace getDefaultNamespace() > > simply to find out what namespace applies to unprefixed names. I > don't need methods that get a list of these things. Would getNamespace("") not suffice? > >> The only real need for getAdditionalNamespaces() is for XMLOutputter. > > > >DOMOutputter and SAXOutputter too. > > > > Yes, but still just for output. I keep thinking there's got to be a > good way to keep this from being exposed outside the org.jdom.output > package. Well, it's something builders need to set. And it's something users may want to control, if for example they want to build a doc from scratch with all namespaces declared on the root for style. -jh- ]