Re: [libxml++] get_children



On Tue, Jul 19, 2005 at 11:27:49AM +0200, Murray Cumming wrote:

> On Tue, 2005-07-19 at 09:49 +0100, Jonathan Wakely wrote:
> > On Mon, Jul 18, 2005 at 11:08:21PM +0000, panoply att net wrote:
> > 
> > > If I have the following document:
> > > 
> > > <?xml version="1.0" encoding="utf-8"?>
> > > <truck id="tip" targ="gamestart">
> > >   <boat id="menuMatrix">
> > >   </boat>
> > >   <state id="start">
> > >   </state>
> > > </truck>
> > > 
> > > ...and through the document provided by the domparser, I have obtained the root element, then should'nt it be true that a "get_children()" call on that root element would return 2, since the root (e.g. "truck") element has only two sub-elements?  Am I missing something here?  I always get a number several higher than what the document presents for child-elements of the root node.
> > 
> > There are empty text node children of the root as well:
> 
> Yes, though they are not empty. They contain whitespace. It's up to the
> application developer to decide what whitespace is significant.

Gah - I was in a hurry and should have said "whitespace-only" not empty.

Apologies for any confusion and thanks for the correction, Murray.

jon






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]