Re: [xml] calling xmlXIncludeProcess after xmlParseFile generates error

Christopher J. Grayce said:

Dear All,

   I would appreciate any enlightment on why this program works as
...but THIS program generates a segmentation violation:

   Clearly I am missing something about when xmlParseFile versus
xmlReadFile should be used.

The reason for this behaviour is really very simple to explain -
there was a bug in the library :-) (xinclude.c, now fixed in CVS).

   I also wonder what the purpose of the third (options) argument to
xmlReadFile is.  Setting it to XML_PARSE_INCLUDE doesn't cause
processing to occur immediately after parsing, as I would have
thought it
would. . .

The option XML_PARSE_INCLUDE is only used by the xmlTextReader
interface, and has no effect when used with xmlReadFile or
xmlParseFile (you can easily check this by doing a "grep
XML_PARSE_INCLUDE *.c" in the library source directory).

   The version of libxml2 is 2.6.4, compiled from source (with no
under RedHat 9.0.

   Thanks in advance,

Try the modified source from CVS - several other problems with
xinclude have also been fixed.  It seems to work okay for me:
bill billsuper list $ ./curious source.xml
<?xml version="1.0"?>
<element xmlns:xi="";>
   <element>what's up, Doc?</element>



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