Re: [xml] xmlNodeAddContent causes segmentation violation error



Christopher J. Grayce said:
Dear Daniel,

   When I do this:

      int options = XML_PARSE_XINCLUDE;

   Then xmlXIncludeProcess() works fine.

   But if I do this:

      int options = XML_PARSE_XINCLUDE | XML_PARSE_NODICT;

   Or even this:

      int options = XML_PARSE_NODICT;

   Then it fails like this:

17_grammar.xml:50: element include: XInclude error : XPointer
evaluation failed: #xpointer(//xques/target)
17_grammar.xml:50: element include: XInclude error : could not load
standard_targets.xml, and no fallback was found
Segmentation fault (core dumped)

   Perhaps my xpointer syntax is wrong, but then I'm puzzled by why
it works the first time.

   This is the stock 2.6.4 library, not the CVS latest version, so
perhaps it is fixed there, but I thought you'd want to know.

   CJG

As I mentioned in my response to your initial list posting for an
xinclude problem, there have been several "enhancements" (I just
don't like that word "bug") to the xinclude and xpointer code.  I
suggest you stick with the CVS latest version (trust me, it is
heavily tested and will be more reliable than the "stock" version). 
If your code fails under the CVS version (when the two options are
specified), please give further details.

On Fri, Jan 02, 2004 at 03:51:15PM -0500, Daniel Veillard wrote:
On Fri, Jan 02, 2004 at 12:39:55PM -0800, Christopher J. Grayce
wrote:
Thanks, Daniel.

   By the way, I thought I *did* use the XML_PARSE_INCLUDE
option in the
program I wrote, please see my previous message; it doesn't
seem to have prevented the problem in this case.  Have I
misunderstood your suggestion?

First XML_PARSE_INCLUDE is not handled yet at the parser level as
an option
except for the xmlReader, I will do this only once XInclude
becomes a W3C
Recommendation, in the meantime use xmlXIncludeProcess() on the
result.

Second use the option XML_PARSE_NODICT to avoid the problem you
saw,
i.e.:

  int options = XML_PARSE_XINCLUDE | XML_PARSE_NODICT;

instead of

  xmlParserOption options = XML_PARSE_XINCLUDE ;

The options argument is an int, not an xmlParserOption, and that
int
is built by or'ing the options selected (or 0).

Daniel

Bill



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