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: Elliotte Rusty Harold <elharo AT metalab.unc.edu>
  • 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 13:04:40 -0800

Mike Colbert wrote:
Replying to myself ...
I just tried doing parent.indexOf (attribute), which returns -1. This is because XOM doesn't consider attributes to be children of parent nodes. I had not noticed this before.
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 at one point in time the X in XOM stood for "XPath". This is a weirdness XOM inherits from XPath which also disinherits attributes. I argued against this in the early days of XPath, but I lost and probably rightly so. Weird as this is, it feels like the right model.


--
Elliotte Rusty Harold elharo AT metalab.unc.edu
XML in a Nutshell 3rd Edition Just Published!
http://www.cafeconleche.org/books/xian3/
http://www.amazon.com/exec/obidos/ISBN=0596007647/cafeaulaitA/ref=nosim





Archive powered by MHonArc 2.6.24.

Top of Page