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 749599 - Validation fails with 'ID %s already defined' when XInclude has a fallback
Validation fails with 'ID %s already defined' when XInclude has a fallback
Status: RESOLVED DUPLICATE of bug 737840
Product: libxml2
Classification: Platform
Component: xinclude
git master
Other Linux
: Normal major
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2015-05-19 20:50 UTC by Ivan Lyanguzov
Modified: 2017-06-17 11:17 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Ivan Lyanguzov 2015-05-19 20:50:40 UTC
When XInclude entry contains fallback, xml:id in included fallback file is not correctly added during xmlHashAddEntry, hence "ID %s already defined" is reported and validation fails.

xi-test.xml:
<?xml version="1.0" encoding="utf-8"?>
<article xmlns:xi="http://www.w3.org/2001/XInclude">
  <xi:include href="non-existent.xml" >
    <xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude">
      <xi:include href="existent.xml" />
    </xi:fallback>
  </xi:include>
</article>

existent.xml:
<?xml version="1.0" encoding="utf-8"?>
<info xml:id="info">
  <title>Test</title>
</info>

non-existent.xml doesn't exist. (If it exists, no errors reported).

$ xmllint --xinclude --noout test-xi.xml
warning: failed to load external entity "non-existent.xml"
test-xi.xml:2: element info: validity error : ID info already defined

This is libxml2 2.9.2+dfsg1-3 as found in Ubuntu 15.04. The bug breaks the work of Publican which rely on Perl library XML::LibXML which is the wrapper to libxml2.
Comment 1 Nick Wellnhofer 2015-08-08 18:16:44 UTC
Probably related to bug #737840.
Comment 2 Nick Wellnhofer 2017-06-17 11:17:39 UTC

*** This bug has been marked as a duplicate of bug 737840 ***