#1111803 libxml2-16: xmllint with both --valid and --relaxng yields "Relax-NG validity error : ID ... redefined" errors for IDs defined via an entity reference #1111803
- Package:
- libxml2-16
- Source:
- libxml2-16
- Description:
- GNOME XML library
- Submitter:
- Vincent Lefevre
- Date:
- 2025-08-23 17:03:02 UTC
- Severity:
- normal
- Tags:
After the upgrade of libxml2 in unstable, xmllint with both --valid and "--relaxng ..." yields "Relax-NG validity error : ID ... redefined" errors. With just one of them (i.e. either DTD validation or Relax-NG validation), the document validates. So this is obviously a bug (and there were no such errors before the upgrade). Note: the other options I'm using are --nonet --noout --noent --xinclude --loaddtd --dtdattr I could provide a simple testcase the week-end if need be (the XML document and associated files are a bit complex). At the same time, I think I should also be able to test it on Android to see if this is specific to Debian.
Obviously, this should have been in the new package.
Control: retitled -1 libxml2-16: xmllint with both --valid and --relaxng yields "Relax-NG validity error : ID ... redefined" errors for IDs defined via an entity reference Something important: There is something like <!ENTITY elem SYSTEM "elem.xml"> in the DTD, and &elem; in the contents. If I replace the "&elem;" by the contents of elem.xml (without the XML prolog), then the error disappears. And the errors concern only the IDs defined via this entity reference.
I can reproduce the bug under Termux/Android, and I've reported the bug upstream, with a simple testcase.
Control: tags -1 fixed-upstream patch The upstream patch against the 2.14 branch[*] (attached) fixes this bug, for both my simple testcase and my actual files. [*] https://gitlab.gnome.org/GNOME/libxml2/-/commit/1172b777fae798e2aacac028963bc31353af1ebc