Re: [xml] XInclude anomality ...

On Tue, Nov 02, 2010 at 11:25:11AM +0000, Ralf Mattes wrote:
Hello list,

I'm trying to understand a strange behavior of libxml2's XInclude
implementation. Given the following fragment:

 <xi:include href="book.xml" xpointer="xpointer(//author)" >
   <xi:fallback>No authors for this book ... </xi:fallback>

If book.xml doesn't exist the fallback will kick in and everything
works as expected, but if book.xml does exist but the xpointer doesn't
return any nodes the inclusion fails with the following error message:

: XPointer evaluation failed: #xpointer(//author)
: could not load /tmp/book.xml, and no fallback was found

Is this a quirk in the specs (but then the error message would be utterly
misleading) of a bug in the implementation?

  That sounds like a bug, but while I get the error, the content seems
correct to me with libxml2 from git:

paphio:~/XML -> xmllint --xinclude tst.xml 
tst.xml:2: element include: XInclude error : XPointer evaluation failed:
tst.xml:2: element include: XInclude error : could not load book.xml,
and no fallback was found
<?xml version="1.0"?>
<inc xmlns:xi="";>
  No authors for this book ... 
paphio:~/XML -> 

  So except for the second line of error which is wrong the processing
however seems correct,


Daniel Veillard      | libxml Gnome XML XSLT toolkit
daniel veillard com  | Rpmfind RPM search engine | virtualization library

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