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: "Michael Kay" <mike AT saxonica.com>
  • To: "'Mike Colbert'" <mbcolbert AT yahoo.com>, <xom-interest AT lists.ibiblio.org>
  • Subject: Re: [XOM-interest] Attributes, ParentNodes, and "child" nodes ...
  • Date: Wed, 15 Mar 2006 16:28:55 -0000

> 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)?

When people ask that question of the XPath model, my usual response is: it
was a mistake to use the word "parent" for the relationship between a node
and its owner, given that (a) we expect parent to be the inverse
relationship of child, and (b) we expect things to have two parents, not
one.

There's always a point at which analogies break down.

Michael Kay






Archive powered by MHonArc 2.6.24.

Top of Page