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



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

Until we have some concept of text nodes I don't think we should demand
that people know what is a text node. Ideally we wouldn't return text
nodes from children(), because we store child text nodes as _content
anyway. But it's not worth worrying about because we'll fix the bigger
problem soon anyway.


> I may be wrong or completely blind, and if it the case I apologise for this 
> last minute bug and all this noise. But right now I need to be convinced.

I have downloaded the 0.17.0 release and repeated the test:

[root localhost dom_build]# ./example
XML built at runtime:
<?xml version="1.0"?>
<!DOCTYPE example_xml_doc PUBLIC "" "example_xml_doc.dtd">
<exampleroot>Some content<examplechild id="2"/></exampleroot>

That shows no <child_of_child> node.

I don't think that it's very useful to parse the output of the
dom_parser example because that seems to write the text content out
twice. That's not a big problem - it's not part of the API.


I am using libxml 2.4.30 from cvs, but I doubt that it makes any
difference:

[root localhost dom_build]# pkg-config libxml-2.0 --modversion
2.4.30


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





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