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: Elliotte Harold <elharo AT metalab.unc.edu>
  • To: Wolfgang Hoschek <wolfgang.hoschek AT mac.com>
  • Cc: xom-interest <xom-interest AT lists.ibiblio.org>
  • Subject: Re: [XOM-interest] adding NamespaceContext.getNamespaces()
  • Date: Tue, 31 Oct 2006 13:03:18 -0500

Wolfgang Hoschek wrote:
I'd really love to reuse nu.xom.XPathContext for XQuery, but to do so realistically one needs a way to get hold of the entire set of stored namespace declarations. For simplicity, I'd advocate to add a single corresponding method to XPathContext:


Not out of the question, but I don't like exposing raw collections classes like map in XOM's API. What's the use case? i.e. what code do you want to write that you can't write now? Would there be another way to do this that simply involved adding a more strongly-typed method or two to XPathContext?

Anyone else need this?


Assuming that happens, it might be considerable to remove the public XPathContext.lookup() method as mostly obsolete - if needed it can be expressed in terms of getNamespaces(). I think there's no compatibility issue since lookup() was only tentatively added in the 1.2 beta series.

Yes, but presumably there was a reason for it. One of XOM's design goals is to provide strongly typed, explicit methods; not weakly typed Collections methods. lookup takes a String and returns a String. Map doesn't.

--
Elliotte Rusty Harold elharo AT metalab.unc.edu
Java I/O 2nd Edition Just Published!
http://www.cafeaulait.org/books/javaio2/
http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/




Archive powered by MHonArc 2.6.24.

Top of Page