xom-interest AT lists.ibiblio.org
Subject: XOM API for Processing XML with Java
List archive
Re: [XOM-interest] adding NamespaceContext.getNamespaces()
- 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/
-
Re: [XOM-interest] adding an iterator() method to nodes
, (continued)
- Re: [XOM-interest] adding an iterator() method to nodes, Steve Loughran, 10/31/2006
-
Re: [XOM-interest] adding an iterator() method to nodes,
Elliotte Harold, 10/31/2006
-
Re: [XOM-interest] adding an iterator() method to nodes,
Steve Loughran, 10/31/2006
-
[XOM-interest] adding NamespaceContext.getNamespaces(),
Wolfgang Hoschek, 10/31/2006
-
Re: [XOM-interest] adding NamespaceContext.getNamespaces(),
Elliotte Harold, 10/31/2006
-
Re: [XOM-interest] adding NamespaceContext.getNamespaces(),
Wolfgang Hoschek, 10/31/2006
-
Re: [XOM-interest] adding NamespaceContext.getNamespaces(),
Elliotte Harold, 10/31/2006
- Re: [XOM-interest] adding NamespaceContext.getNamespaces(), Christian Vest Hansen, 10/31/2006
- Re: [XOM-interest] adding NamespaceContext.getNamespaces(), Elliotte Harold, 10/31/2006
- Re: [XOM-interest] adding NamespaceContext.getNamespaces(), Wolfgang Hoschek, 10/31/2006
- Re: [XOM-interest] adding NamespaceContext.getNamespaces(), Elliotte Harold, 10/31/2006
-
Re: [XOM-interest] adding NamespaceContext.getNamespaces(),
Elliotte Harold, 10/31/2006
-
Re: [XOM-interest] adding NamespaceContext.getNamespaces(),
Wolfgang Hoschek, 10/31/2006
-
Re: [XOM-interest] adding NamespaceContext.getNamespaces(),
Michael Kay, 10/31/2006
- Re: [XOM-interest] adding NamespaceContext.getNamespaces(), Wolfgang Hoschek, 10/31/2006
-
Re: [XOM-interest] adding NamespaceContext.getNamespaces(),
Elliotte Harold, 10/31/2006
-
[XOM-interest] adding NamespaceContext.getNamespaces(),
Wolfgang Hoschek, 10/31/2006
-
Re: [XOM-interest] adding an iterator() method to nodes,
Steve Loughran, 10/31/2006
Archive powered by MHonArc 2.6.24.