GNOME Bugzilla – Bug 129967
xinclude 2003, coredump on StringRange
Last modified: 2009-08-15 18:40:50 UTC
Code is from CVS, dated by 24 December 2003. Source XML files: ----- <source.xml> <chapter> <p>Sentence 1. Sentence 2.</p> <p><i>Sentence 3. Sentence 4.</i> Sentence 5.</p> </chapter> ----- </source.xml> ----- <document.xml> <?xml version='1.0'?> <document> <p>The relevant excerpt is:</p> <quotation> <include xmlns="http://www.w3.org/2003/XInclude" href="source.xml" xpointer="xpointer(string-range(chapter/p[1],'Sentence 2')/ range-to(string-range(chapter/p[2]/i,'3.',1,2)))"/> </quotation> </document> ----- </document.xml> It is expected that after processing of XInclude result is: ----- <expected> <?xml version='1.0'?> <document> <p>The relevant excerpt is:</p> <quotation> <p xml:base="http://www.example.com/source.xml">Sentence 2.</p> <p xml:base="http://www.example.com/source.xml"><i>Sentence 3.</i></p> </quotation> </document> ----- <expected> but actual result is: ----- <screen> $ ~/p/libxml/bin/xmllint --xinclude document.xml Segmentation fault (core dumped) $ gdb ~/p/libxml/bin/xmllint core ...
+ Trace 42888
I have implemented (in CVS) substantial changes to xpath.c, xinclude.c and xpointer.c which seem to fix this problem. Please note that the xpointer expression needs an additional '/', within the second string-range, i.e.: xpointer="xpointer(string-range(chapter/p[1],'Sentence 2')/ range-to(string-range(/chapter/p[2]/i,'3.',1,2)))"/> Please try out these changes and report any further trouble - thanks! Bill
Thanks for fixing! I'll return back in the beginning of the January. Happy New Year!
Thanks, works. Closing.