Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Attributes, ParentNodes, and "child" nodes ...

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: John Cowan <cowan AT ccil.org>
  • To: Mike Colbert <mbcolbert AT yahoo.com>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] Attributes, ParentNodes, and "child" nodes ...
  • Date: Wed, 15 Mar 2006 10:47:27 -0500

Mike Colbert scripsit:

> Why is an Attribute a Node that has a ParentNode as a parent, as
> returned by attribute.getParent(), but at the same time it's not a
> child of a ParentNode, as returned by parent.getChild(n)?

Because attributes are schizophrenic: they belong to an element, but they
aren't part of the ordered sequence of children of that element, as
character content, child elements, processing instructions, and comments are.
Attribute.getParent is conceptually different from the other getParent
methods, and arguably should have been called getElement or something.

--
John Cowan
cowan AT ccil.org
I am a member of a civilization. --David Brin




Archive powered by MHonArc 2.6.24.

Top of Page