Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] The mysterious LeafNode class

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: "Bradley S. Huffman" <hip AT a.cs.okstate.edu>
  • To: Elliotte Rusty Harold <elharo AT metalab.unc.edu>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] The mysterious LeafNode class
  • Date: Fri, 20 Sep 2002 15:48:31 -0500

Elliotte Rusty Harold writes:

> At 9:11 AM -0500 9/20/02, Bradley S. Huffman wrote:
> >My reason would be that children have order so previous and next make
> >sense. Attributes are unordered so previous and next don't. BTW, I did
> >this with a experimental version of JDOM and to me it just wasn't that
> >usefull and one method to obtain a List or array of attributes was
> >good enough.
> >
>
> I'm in radical agreement that attributes don't have order, and that
> we can't reproduce order from input. However, there are many use
> cases in which you do not know a priori the names of the attributes
> on any given element (XSLT and XInclude to name two). Thus it is
> useful and necessary to retrieve the complete set of attributes from
> an element.

Yep, my point was suppose to be that 1 simple way to make a quick, one-way
pass through the attributes is sufficient. Attributes and getAttributes()
provide this, adding previousAttribute/nextAttribute type methods would
IMHO never be used.

To me, attributes aren't like other nodes (if nodes at all), you not going
to be jumping all over the place from branch to branch, either 1) you know
what you want and ask the element if it has it, or 2) want to make a quick
scan to see what's there. To me a slew of methods for first, last, next,
previous, etc. in the context of attributes would be of no real value. For
elements and other mixed content they are, but for attributes they're not.


Who was it that said "the hardest part of design is what to leave out"?

Brad




Archive powered by MHonArc 2.6.24.

Top of Page