GNOME Bugzilla – Bug 305294
Resolution of doctype decls should try the public identifier first before the system identifier
Last modified: 2021-07-05 11:01:15 UTC
When processing a file like the following <?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg>...</svg> xsltproc tries to resolve the system identifier "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" instead of the public identifier "-//W3C//DTD SVG 1.1//EN". This results in downloading the DTD from the net instead of using the local file associated with the public identifier through the catalog system. (I know, there is a posibility to associate a local version to the system identifier through the catalogue system, but this association is not installed by default on some systems e.g. SuSE/9.2).
What does the debug trace gives ? This sounds suspicious to me... http://xmlsoft.org/catalog.html#validate Daniel
Here is what xsltproc prints with the option XML_DEBUG_CATALOG set: > env XML_DEBUG_CATALOG=1 xsltproc trafo.xsl image.svg Resolve: pubID -//W3C//DTD SVG 1.1//EN sysID http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd -1210923392 Parsing catalog file:///etc/xml/catalog file:///etc/xml/catalog added to file hash file:///etc/xml/suse-catalog.xml not found in file hash -1210923392 Parsing catalog file:///etc/xml/suse-catalog.xml file:///etc/xml/suse-catalog.xml added to file hash file:///etc/xml/svg-1.1.xml not found in file hash -1210923392 Parsing catalog file:///etc/xml/svg-1.1.xml file:///etc/xml/svg-1.1.xml added to file hash Trying system delegate file:///etc/xml/svg-1.1.xml Resolve URI http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd Resolve: pubID -//W3C//ENTITIES SVG 1.1 Modular Framework//EN sysID http://www.w3.org/Graphics/SVG/1.1/DTD/svg-framework.mod Trying system delegate file:///etc/xml/svg-1.1.xml Resolve URI http://www.w3.org/Graphics/SVG/1.1/DTD/svg-framework.mod Resolve: pubID -//W3C//ENTITIES SVG 1.1 Datatypes//EN sysID http://www.w3.org/Graphics/SVG/1.1/DTD/svg-datatypes.mod Trying system delegate file:///etc/xml/svg-1.1.xml Resolve URI http://www.w3.org/Graphics/SVG/1.1/DTD/svg-datatypes.mod Resolve: pubID -//W3C//ENTITIES SVG 1.1 Qualified Name//EN sysID http://www.w3.org/Graphics/SVG/1.1/DTD/svg-qname.mod Trying system delegate file:///etc/xml/svg-1.1.xml Resolve URI http://www.w3.org/Graphics/SVG/1.1/DTD/svg-qname.mod Resolve: pubID -//W3C//ENTITIES SVG 1.1 Document Model//EN sysID http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-model.mod ... and so on. There is network activity during the processing of theses steps. The prolog of the processed file is: <?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> My version of xsltproc is: > xsltproc --version Using libxml 20612, libxslt 10109 and libexslt 807 xsltproc was compiled against libxml 20612, libxslt 10109 and libexslt 807 libxslt 10109 was compiled against libxml 20612 libexslt 807 was compiled against libxml 20612 The public identifier is installed on the system. > xmlcatalog /etc/xml/catalog "-//W3C//DTD SVG 1.1//EN" file:///usr/share/xml/svg/schema/dtd/1.1/svg11.dtd There is no rewriting rule installed for the system identifier on the system. > xmlcatalog /etc/xml/catalog "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" No entry for SYSTEM http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd No entry for URI http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd Exitcode 4
First thing: update current versions are libxml2 2.6.19 and libxslt-1.1.14 Second try the --nonet option of xsltproc. Daniel
Same effect: > rpm -q --whatprovides `which xsltproc` libxslt-1.1.14-0.1 > rpm -q --whatprovides `which xmlcatalog` libxml2-2.6.19-0.1 > xsltproc --version Using libxml 20619, libxslt 10114 and libexslt 812 xsltproc was compiled against libxml 20619, libxslt 10114 and libexslt 812 libxslt 10114 was compiled against libxml 20619 libexslt 812 was compiled against libxml 20619 > env XML_DEBUG_CATALOG=1 xsltproc src/xslt/import/svg/svg2draw.xsl tests/NewCoordSys.svg Resolve: pubID -//W3C//DTD SVG 1.1//EN sysID http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd -1211448224 Parsing catalog file:///etc/xml/catalog file:///etc/xml/catalog added to file hash file:///etc/xml/suse-catalog.xml not found in file hash -1211448224 Parsing catalog file:///etc/xml/suse-catalog.xml file:///etc/xml/suse-catalog.xml added to file hash file:///etc/xml/svg-1.1.xml not found in file hash -1211448224 Parsing catalog file:///etc/xml/svg-1.1.xml file:///etc/xml/svg-1.1.xml added to file hash Trying system delegate file:///etc/xml/svg-1.1.xml Resolve URI http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd Resolve: pubID -//W3C//ENTITIES SVG 1.1 Modular Framework//EN sysID http://www.w3.org/Graphics/SVG/1.1/DTD/svg-framework.mod Trying system delegate file:///etc/xml/svg-1.1.xml Resolve URI http://www.w3.org/Graphics/SVG/1.1/DTD/svg-framework.mod Resolve: pubID -//W3C//ENTITIES SVG 1.1 Datatypes//EN sysID http://www.w3.org/Graphics/SVG/1.1/DTD/svg-datatypes.mod Trying system delegate file:///etc/xml/svg-1.1.xml Resolve URI http://www.w3.org/Graphics/SVG/1.1/DTD/svg-datatypes.mod Resolve: pubID -//W3C//ENTITIES SVG 1.1 Qualified Name//EN sysID http://www.w3.org/Graphics/SVG/1.1/DTD/svg-qname.mod ... > xmlcatalog /etc/xml/catalog "-//W3C//DTD SVG 1.1//EN" file:///usr/share/xml/svg/schema/dtd/1.1/svg11.dtd > xmlcatalog /etc/xml/catalog "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" No entry for SYSTEM http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd No entry for URI http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd Exitcode 4
Ahh, in the heat of the battle, I forgot the --nonet option: > env XML_DEBUG_CATALOG=1 xsltproc --nonet src/xslt/import/svg/svg2draw.xsl tests/NewCoordSys.svg Resolve: pubID -//W3C//DTD SVG 1.1//EN sysID http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd -1211448224 Parsing catalog file:///etc/xml/catalog file:///etc/xml/catalog added to file hash file:///etc/xml/suse-catalog.xml not found in file hash -1211448224 Parsing catalog file:///etc/xml/suse-catalog.xml file:///etc/xml/suse-catalog.xml added to file hash file:///etc/xml/svg-1.1.xml not found in file hash -1211448224 Parsing catalog file:///etc/xml/svg-1.1.xml file:///etc/xml/svg-1.1.xml added to file hash Trying system delegate file:///etc/xml/svg-1.1.xml Resolve URI http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd I/O error : Attempt to load network entity http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd tests/NewCoordSys.svg:3: warning: failed to load external entity "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> ^
reopening as requested information has been provided. haui, do you still face this issue?
The trabce shows that Resolve: pubID -//W3C//ENTITIES SVG 1.1 Modular Framework//EN sysID i.e. the lookup is *also* done based on the public identifier but fails. I guess there is a problem in the catalog files. Daniel
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/libxslt/-/issues/ Thank you for your understanding and your help.