Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] ParentNode::getChildCount()

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: "David Ondzes" <dao AT pobox.com>
  • To: "Elliotte Harold" <elharo AT metalab.unc.edu>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] ParentNode::getChildCount()
  • Date: Mon, 5 Mar 2007 17:03:17 -0500

On 3/5/07, Elliotte Harold <elharo AT metalab.unc.edu> wrote:
David Ondzes wrote:
> Is ParentNode::getChildCount() suppose to return 1 when it has parsed
> something like this below ? Or should it be returning 0 ?
>
> <foo>
> </foo>

1. There's a text node in there that consists of white space. If you
parsed <foo></foo> you'd get 0 for the child count.

When I get child count of 1 how can i determine if my xml was
<foo>
</foo>

or
<foo>


> Also, the count return by this member function is different then what
> I am expect. It is returning a number much higher.

I expect you're ignoring text nodes.

Ah. I XOM was returning 2C+1 children when I was expecting C.




Archive powered by MHonArc 2.6.24.

Top of Page