Re: [Libxmlplusplus-general] write() broken, maybe fixed



On Mon, 2002-12-16 at 16:09, Christophe de VIENNE wrote:
> Le Lundi 16 Décembre 2002 14:54, Murray Cumming a écrit :
> > On Mon, 2002-12-16 at 15:18, Christophe de VIENNE wrote:
> > > May I ask you how did you add the content to your nodes in your app ?
> > > using add_content or set_content ? In the later case this accessor should
> > > be used only on the text node itself, not on it's parent. And this could
> > > explain how could some nodes have both a non empty _content and some
> > > children.
> >
> > I didn't know that we had add_content(). It seems to add a name-less
> > child node. I don't know why we have it. set_content() seems clear
> > enough. Note that I use set_content() in
> 
> At least we now know why we don't anderstand each other...
> 
> >
> > Until we have some concept of text nodes I don't think we should demand
> > that people know what is a text node.
> 
> agree.
> 
> > Ideally we wouldn't return text nodes from children(),
> 
> ideally yes. The current behavior is a unhappy compromise which leads to 
> confusions. It's one of the reason I wanted to change all of this.
> 
> > because we store child text nodes as _content anyway.
> 
> no. The _content attribute is used only in text nodes, and it has always been 
> like this in libxml++.

"always" is very unclear. I don't think that libxml++ was usable before
0.16.0 and I think that the current API represents text as "content"
rather than as child nodes of a certain type.

What you suggest seems very silly:
NodeText = node.add_content("some text");
nodeText->set_content("changed text");

What I suggest seems clearer:
node->set_content("some text");
node->set_content("changed text");

> yes. By the way, I want to warn people waiting for these changes that I have a 
> lack of time this week and next one. So the next release shouldn't happen 
> before beginning of january.

Which effectively means the middle of January at the latest.

I wouldn't worry about this temporary problem, but this makes it not so
temporary.
 
>  I'll keep you informed anyway, as I may ask some 
> feedback on certain

> If you don't mind, we'll go back on your last change on node.cc, and correct 
> the dom_build example.
> Since we didn't do any big changes since the last release, we can do a 0.17.1 
> version release including the fix.

I would prefer to
a)
remove add_content() because it seems unnecessary and leads to
confusion.
b)
Hear about any problems with the current code. Maybe you need to repeat
something from the previous emails.

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





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