GNOME Bugzilla – Bug 753997
"Detected an entity reference loop" with DITA 1.3 DTDs
Last modified: 2021-07-05 13:23:50 UTC
Created attachment 309896 [details] An unremarkable DITA XML file Validating the attached XML document against the DITA 1.3 DTDs[1] with xmllint causes the "Detected an entity reference loop" error to be thrown: ----- $ xmllint --dtdvalid dita-v1.3-csprd01-part3-all-inclusive-grammars/dtd/technicalContent/dtd/topic.dtd topic1.dita /etc/xml/common/schemas/dita/dita-1.3/dtd/technicalContent/dtd/svgDomain.mod:36: parser error : Detected an entity reference loop #IMPLIED" ^ /etc/xml/common/schemas/dita/dita-1.3/dtd/technicalContent/dtd/svgDomain.mod:39: parser warning : PEReference: %svg-container.attributes; not found <!ATTLIST svg-container %svg-container.attributes;> ^ /etc/xml/common/schemas/dita/dita-1.3/dtd/technicalContent/dtd/svgDomain.mod:61: parser warning : PEReference: %svgref.content; not found <!ELEMENT svgref %svgref.content;> ^ /etc/xml/common/schemas/dita/dita-1.3/dtd/technicalContent/dtd/svgDomain.mod:61: parser error : xmlParseElementDecl: 'EMPTY', 'ANY' or '(' expected <!ELEMENT svgref %svgref.content;> ^ /etc/xml/common/schemas/dita/dita-1.3/dtd/technicalContent/dtd/svgDomain.mod:61: parser error : Content error in the external subset <!ELEMENT svgref %svgref.content;> ----- Removing some unknown amount of insignificant whitespace (for example, removing all indentation) from dita-v1.3-csprd01-part3-all-inclusive-grammars/dtd/base/dtd/commonElements.mod "fixes" the "error". [1] http://docs.oasis-open.org/dita/dita/v1.3/csprd01/part3-all-inclusive/dita-v1.3-csprd01-part3-all-inclusive-grammars.zip
This seems to be a regression in 2.9.2 — it works on 2.9.1.
Having recently run into this same problem, I used "git bisect" to find the commit that introduced the change in behavior: be2a7edaf289c5da74a4f9ed3a0b6c733e775230 (Fix for CVE-2014-3660). DITA, by its nature, relies more heavily on entity expansion that other XML vocabularies and so triggers libxml2's protection against exponential entity expansion. Maybe the parameters of this check can be tweaked to allow DITA 1.3 documents to be validated? In the meantime, passing the --huge option to xmllint disables the check (and works for me).
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/libxml2/-/issues/ Thank you for your understanding and your help.