GNOME Bugzilla – Bug 616491
Error message weirdness when processing xincludes that use fallbacks
Last modified: 2019-09-13 15:56:12 UTC
I'm getting some inconsistent error messages when processing xincludes. For instance, when processing the following document: <?xml version='1.0' ?> <a xmlns:xi="http://www.w3.org/2001/XInclude"> <xi:include href="b.xml" /> <xi:include href="c.xml"> <xi:fallback><d/></xi:fallback> </xi:include> </a> (saved as test.xml, note that 'b.xml' and 'c.xml' do not actually exist). Running 'xmllint --xinclude test.xml' gives the following output: warning: failed to load external entity "b.xml" testcase.xml:3: element include: XInclude error : could not load b.xml, and no fallback was found warning: failed to load external entity "c.xml" testcase.xml:4: element include: XInclude error : could not load c.xml, and no fallback was found <?xml version="1.0"?> <a xmlns:xi="http://www.w3.org/2001/XInclude"> <xi:include href="b.xml"/> <d/> </a> Note that it says 'no fallback was found' for c.xml, despite it having found and processed the fallback. If I remove the the reference to b.xml, as follows: <?xml version='1.0' ?> <a xmlns:xi="http://www.w3.org/2001/XInclude"> <xi:include href="c.xml"> <xi:fallback><d/></xi:fallback> </xi:include> </a> I now get the expected behaviour: warning: failed to load external entity "c.xml" <?xml version="1.0"?> <a xmlns:xi="http://www.w3.org/2001/XInclude"> <d/> </a> Following is the output of 'xmllint --version'. I am using stock installs of libxml2 from Fedora 10. xmllint: using libxml version 20706 compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1 FTP HTTP DTDValid HTML Legacy C14N Catalog XPath XPointer XInclude Iconv ISO8859X Unicode Regexps Automata Expr Schemas Schematron Modules Debug Zlib
Fixed here: https://gitlab.gnome.org/GNOME/libxml2/commit/e32afd3fd7785d861066dd06f93266cb6f433969