xom-interest AT lists.ibiblio.org
Subject: XOM API for Processing XML with Java
List archive
Re: [XOM-interest] Attributes, ParentNodes, and "child" nodes ...
- 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
-
Re: [XOM-interest] Attributes, ParentNodes, and "child" nodes ...
, (continued)
- Re: [XOM-interest] Attributes, ParentNodes, and "child" nodes ..., Wolfgang Hoschek, 03/15/2006
- Re: [XOM-interest] Attributes, ParentNodes, and "child" nodes ..., John Cowan, 03/16/2006
- Re: [XOM-interest] Attributes, ParentNodes, and "child" nodes ..., Mike Colbert, 03/16/2006
- Re: [XOM-interest] Attributes, ParentNodes, and "child" nodes ..., John Cowan, 03/16/2006
- Re: [XOM-interest] Attributes, ParentNodes, and "child" nodes ..., Mike Colbert, 03/16/2006
- Re: [XOM-interest] Attributes, ParentNodes, and "child" nodes ..., Michael Kay, 03/16/2006
- Re: [XOM-interest] Attributes, ParentNodes, and "child" nodes ..., Tatu Saloranta, 03/16/2006
-
Re: [XOM-interest] Attributes, ParentNodes, and "child" nodes ...,
Gregory Garretson, 03/15/2006
- Re: [XOM-interest] Attributes, ParentNodes, and "child" nodes ..., Michael Kay, 03/15/2006
Archive powered by MHonArc 2.6.24.