"Detected an entity reference loop" with DITA 1.3 DTDs
This bug was originally reported as bug 753997 on the Gnome bugzilla. I was not the original reporter but have just verified that the problem is still present (using the latest code from the master
branch as of 2021-07-20).
Validating the attached XML document against the DITA 1.3 DTDs with xmllint causes the "Detected an entity reference loop" error to be thrown:
jsb@pequod:~/src/xml/dita/dita-samples$ ~/libxml2/bin/xmllint --dtdattr minimal-01.dita
/home/jsb/3p/dita-ot/plugins/org.oasis-open.dita.v1_3/dtd/technicalContent/dtd/svgDomain.mod:36: parser error : Detected an entity reference loop
#IMPLIED"
^
/home/jsb/3p/dita-ot/plugins/org.oasis-open.dita.v1_3/dtd/technicalContent/dtd/svgDomain.mod:38: parser error : xmlParseElementDecl: 'EMPTY', 'ANY' or '(' expected
<!ELEMENT svg-container %svg-container.content;>
^
/home/jsb/3p/dita-ot/plugins/org.oasis-open.dita.v1_3/dtd/technicalContent/dtd/svgDomain.mod:38: parser error : Content error in the external subset
<!ELEMENT svg-container %svg-container.content;>
^
Note that I have the XML_CATALOG_FILES
environment variable set to include the catalog-dita.xml
file, in the plugins/org.dita.base
of version 3.6.1 of the DITA Open Toolkit.
When I first ran into this problem, I used "git bisect" to find the commit that introduced the change in behavior: be2a7eda (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).