Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Traversing Attributes and Namespace Declarations

xom-interest AT

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Rusty Harold <elharo AT>
  • To: "Bradley S. Huffman" <hip AT>
  • Cc: xom-interest AT
  • Subject: Re: [XOM-interest] Traversing Attributes and Namespace Declarations
  • Date: Sun, 4 May 2003 12:32:39 -0400

Any thoughts on getting rid of getAttributeCount(), getAttribute(index),
getNamespaceDeclarationCount(), getNamespaceDeclaration(index) in favor
of two methods, getAttributes(), getNamespaceDeclarations(), that return a
iterator. I'm guessing you don't like java iterators cause they're not type
safe, but index operations on attributes and declarations just seems weird.

I think we had something close to that at one point. I'm absolutely not going to uuse a type-unsafe iterator. And I will use indexed access, as SAX does.

However, I could see exposing the existing package protected Attributes and Namespaces classes publicly; not all of them but enough of them to allow read-only access. However, this would add at least two classes and four methods, a net gain of two classes. On the other hand, perhaps more smaller classes is better, I admit that I'm uncomfortable with how big Element is. But I'm not convinced yet.

What does everyone else think?
Elliotte Rusty Harold
elharo AT
Processing XML with Java (Addison-Wesley, 2002)

Archive powered by MHonArc 2.6.24.

Top of Page