GNOME Bugzilla – Bug 749599
Validation fails with 'ID %s already defined' when XInclude has a fallback
Last modified: 2017-06-17 11:17:39 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.
Probably related to bug #737840.
*** This bug has been marked as a duplicate of bug 737840 ***