After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 616491 - Error message weirdness when processing xincludes that use fallbacks
Error message weirdness when processing xincludes that use fallbacks
Status: RESOLVED FIXED
Product: libxml2
Classification: Platform
Component: xinclude
2.7.6
Other Linux
: Normal minor
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2010-04-22 09:31 UTC by ancl
Modified: 2019-09-13 15:56 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description ancl 2010-04-22 09:31:33 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