xom-interest AT lists.ibiblio.org
Subject: XOM API for Processing XML with Java
List archive
Re: [XOM-interest] adding an iterator() method to nodes
- From: "Steve Loughran" <steve.loughran 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 an iterator() method to nodes
- Date: Tue, 31 Oct 2006 14:32:16 +0000
On 31/10/06, Elliotte Harold <elharo AT metalab.unc.edu> wrote:
Steve Loughran wrote:
> Given that Nodes is implemented by a List internally, the cost of
> adding a method to access it is pretty low:
>
> public iterator() { return nodes.iterator();}
>
> This would make it trivial to bridge over into java 5 iterators,
> instead of trying to re-implement a list iterator, which is the sole
> option today.
>
> Thoughts?
>
That either requires Java 5 or violates type-safety. And it violates the
"there's exactly one way to do it" principle.
I wasnt pushing for xom to move to j5; I dont advocate that one-way
transition unless all your users are clamouring for it. Its just I
have added some j5 support on the side, and it was more tricky than it
should be, just because the iterator() method wasnt there.
Being able to iterate over things does make working with XML easier:
for(Node n:message.xpath("muws-p2-xs:StateTransition/*", catalog)) {
SoapElement e=(SoapElement) n;
//act on the element
}
-steve
-
[XOM-interest] adding an iterator() method to nodes,
Steve Loughran, 10/31/2006
-
Re: [XOM-interest] adding an iterator() method to nodes,
Randall R Schulz, 10/31/2006
-
Re: [XOM-interest] adding an iterator() method to nodes,
Steve Loughran, 10/31/2006
- Re: [XOM-interest] adding an iterator() method to nodes, Randall R Schulz, 10/31/2006
-
Re: [XOM-interest] adding an iterator() method to nodes,
Ed Davies, 10/31/2006
-
Re: [XOM-interest] adding an iterator() method to nodes,
Steve Loughran, 10/31/2006
-
Re: [XOM-interest] adding an iterator() method to nodes,
Christian Vest Hansen, 10/31/2006
- Re: [XOM-interest] adding an iterator() method to nodes, Michael Kay, 10/31/2006
- Re: [XOM-interest] adding an iterator() method to nodes, Steve Loughran, 10/31/2006
-
Re: [XOM-interest] adding an iterator() method to nodes,
Christian Vest Hansen, 10/31/2006
-
Re: [XOM-interest] adding an iterator() method to nodes,
Steve Loughran, 10/31/2006
-
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
-
Re: [XOM-interest] adding an iterator() method to nodes,
Randall R Schulz, 10/31/2006
Archive powered by MHonArc 2.6.24.