Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] collections

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • 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] collections
  • Date: Wed, 15 Feb 2006 18:38:46 +0200

On 2/15/06, Elliotte Harold <elharo AT metalab.unc.edu> wrote:
> Romain Deltour wrote:
> > Hi all,
> >
> > Elements and Nodes classes don't have any method to get a
> > java.util.Collection representation of their content. Could you please
> > tell me the reasons why this feature wasn't implemented ?
> >
>
> Because it's way on the wrong side of 80/20. It's simple enough to do
> this yourself if you need to. I'm not going to put a method in XOM for
> everything anyone might ever need to do.

Romain,

Like Elliotte says, its easy to do

If you are curious, I have java5 iteration bound to it
http://cvs.sourceforge.net/viewcvs.py/smartfrog/core/extras/cdl/src/org/smartfrog/sfcore/languages/cdl/dom/ElementEx.java?view=markup
http://cvs.sourceforge.net/viewcvs.py/smartfrog/core/components/xml/src/org/smartfrog/services/xml/java5/iterators/

This lets me go

for(Node n:element) {
}

I'd like an Element iterator that only iterates over child elements,
but am too lazy to implement the class and tests, so make do without
it.




Archive powered by MHonArc 2.6.24.

Top of Page