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

Re: [xml] Using xmlParserNodeInfo



On Fri, Feb 21, 2003 at 01:10:43PM -0800, Glenn W. Bach wrote:
> >   Hum, right this bit should be inherited in the child context !
> > The enclosed patch should fix this,
> 
> I'm a little concerned about the node_seq. When 
> xmlParseExternalEntityPrivate is finished, it returns the nodeset. 
> Doesn't it also have to return the node_seq? Even if it is recording the 
> node info, it seems that as soon as the pseudo context is freed, all of 
> the node info will be lost.

  right you need to pass that one too and avoid freeing it at the end of the
routine.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
Index: parser.c
===================================================================
RCS file: /cvs/gnome/gnome-xml/parser.c,v
retrieving revision 1.245
diff -c -r1.245 parser.c
*** parser.c	19 Feb 2003 14:49:59 -0000	1.245
--- parser.c	21 Feb 2003 21:59:33 -0000
***************
*** 9685,9690 ****
--- 9685,9694 ----
  	ctxt->loadsubset = oldctxt->loadsubset;
  	ctxt->validate = oldctxt->validate;
  	ctxt->external = oldctxt->external;
+ 	ctxt->record_info = oldctxt->record_info;
+ 	ctxt->node_seq.maximum = oldctxt->node_seq.maximum;
+ 	ctxt->node_seq.length = oldctxt->node_seq.length;
+ 	ctxt->node_seq.buffer = oldctxt->node_seq.buffer;
      } else {
  	/*
  	 * Doing validity checking on chunk without context
***************
*** 9703,9708 ****
--- 9707,9715 ----
      }
      newDoc = xmlNewDoc(BAD_CAST "1.0");
      if (newDoc == NULL) {
+ 	ctxt->node_seq.maximum = 0;
+ 	ctxt->node_seq.length = 0;
+ 	ctxt->node_seq.buffer = NULL;
  	xmlFreeParserCtxt(ctxt);
  	return(-1);
      }
***************
*** 9717,9722 ****
--- 9724,9732 ----
      if (newDoc->children == NULL) {
  	if (sax != NULL)
  	    ctxt->sax = oldsax;
+ 	ctxt->node_seq.maximum = 0;
+ 	ctxt->node_seq.length = 0;
+ 	ctxt->node_seq.buffer = NULL;
  	xmlFreeParserCtxt(ctxt);
  	newDoc->intSubset = NULL;
  	newDoc->extSubset = NULL;
***************
*** 9809,9814 ****
--- 9819,9827 ----
      }
      if (sax != NULL) 
  	ctxt->sax = oldsax;
+     ctxt->node_seq.maximum = 0;
+     ctxt->node_seq.length = 0;
+     ctxt->node_seq.buffer = NULL;
      xmlFreeParserCtxt(ctxt);
      newDoc->intSubset = NULL;
      newDoc->extSubset = NULL;


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