Re: [xml] Pasting fragment

On Thu, Aug 22, 2002 at 04:51:43PM +0200, chrisbee xml swing be wrote:
On Thu, Aug 22, 2002 at 03:50:37PM +0200, chrisbee xml swing be wrote: 
On Thu, Aug 22, 2002 at 01:41:52PM +0200, chrisbee xml swing be wrote: 
looks okay a priori. But I really can't understand why you don't 
want to pass node->doc to xmlParseBalancedChunkMemory() , to later 
update it everywhere in the resulting nodes ... This makes absolutely no 
sense to me ! 
Because I do some tests before and calling xmlParseBalancedChunkMemory() 
initialized doc->children with the result node llist. But it seems that 
this happens only if doc->children is NULL (Is this a bug ?). At this 

I don't see in the code how this could happen. It doesn't touch 
doc->children ! 
Yes, it does !
Here is the Call Stack ...
5. startElement()
4. xmlParseStartTag()
3. xmlParseElement()
2. xmlParseContent()
1. xmlParseBalancedChunkMemory()
and the lines that modify children
    if (ctxt->myDoc->children == NULL) {
 xmlGenericError(xmlGenericErrorContext, \"Setting %s as root\\n\", name);
        xmlAddChild((xmlNodePtr) ctxt->myDoc, (xmlNodePtr) ret);

  Grumble, xmlParseBalancedChunkMemoryRecover() try to take care of it
but in the extreme case where doc has no children the input document is
modified. Please report it in bugzilla so it doesn't fall through the cracks...


Daniel Veillard      | Red Hat Network
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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