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 14:27:15 -0500

Wolfgang Hoschek wrote:

Since the XPathContext doesn't maintain the current iteration state, it must recreate it for each iteration step. Thus, advancing to the next item is O(N). Enumerating all items is O(N^2).

When I'm feeling devious, one problem I give my students is how to turn pretty much this problem into an O(N) operation without changing the API. :-)

Or I could just return a String array of prefixes, and make it one method call.

Yes, that's much better: Simple, straighforward and relatively efficient.

If that will satisfy you, I'll probably go with that.


--
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