Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] adding NamespaceContext.getNamespaces()

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: "Christian Vest Hansen" <karmazilla AT gmail.com>
  • To: "Elliotte Harold" <elharo AT metalab.unc.edu>
  • Cc: xom-interest <xom-interest AT lists.ibiblio.org>
  • Subject: Re: [XOM-interest] adding NamespaceContext.getNamespaces()
  • Date: Tue, 31 Oct 2006 20:07:58 +0100

2006/10/31, Elliotte Harold <elharo AT metalab.unc.edu>:
Wolfgang Hoschek wrote:

> If you'd rather like to expose the namespace map in a strongly typed
> manner, fine. For example via getNamespaceCount(),
> getNamespacePrefix(int), getNamespaceURI(int).

That's what I was wondering if you're doing. We could actually cut that
down to two methods, at some cost in speed by replacing
getNamespaceURI(int) with a getNamespacePrefix(int) followed by a
lookup. Usually there's less than a dozen mappings (often only or two)
so this might not matter a great deal. Or I could just return a String
array of prefixes, and make it one method call.

None of these options are all that difficult. I'm much more concerned
with getting the right API, than with saving a half hour of coding.

NamespaceMap, perhaps? As a stronly typed, thin wrapper around the internal
map?
Just throwing in a suggestion...

Cheers

--
"All good software releases were accidents corrected in the next version."




Archive powered by MHonArc 2.6.24.

Top of Page