[Libxmlplusplus-general] Re: has_content()



On Tue, 2002-12-03 at 16:50, Christophe de VIENNE wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hi murray,
> 
> I've just realised that in node.cc version 1.8, you commited this:
>         - Rename is_content() to has_content(), because that's what it tells
>         us. Removed _is_content member bool - we can check _content.empty()
>         instead.
> 
> Well, my anderstanding of that is different : the accessor had, for me, the 
> right name. If we look at the tree generated by libxml, the correponding node 
> has a particular type, XML_TEXT_NODE, and cannot have any attribute/children.
> A xml code like "<name>foo</name>" will generate 2 nodes. One named "name", 
> and another which IS the content ("foo").

I agree that a is_content() might be useful, but I don't think that's
how libxml++ works at the moment. Content nodes (text nodes) are not
provided separately - the content is associated with other nodes.

Your idea would make sense, and I might be completely wrong anyway, but
if you change anything then you should demonstrate that the concept
works in an example.

> Do you agree or did I get something wrong ?
> 
> Anyway I'm thinking of creating a special class for content nodes.
> 
> The thing I don't know yet is : can 'normal' node has both content node AND 
> 'normal' children ?

No, I don't thinks so.

-- 
Murray Cumming
murray usa net
www.murrayc.com





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