After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 305294 - Resolution of doctype decls should try the public identifier first before the system identifier
Resolution of doctype decls should try the public identifier first before the...
Status: RESOLVED OBSOLETE
Product: libxslt
Classification: Platform
Component: general
1.1.9
Other Linux
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2005-05-24 09:07 UTC by haui
Modified: 2021-07-05 11:01 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description haui 2005-05-24 09:07:05 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).
Comment 1 Daniel Veillard 2005-05-24 09:47:29 UTC
What does the debug trace gives ? This sounds suspicious to me...

http://xmlsoft.org/catalog.html#validate

Daniel
Comment 2 haui 2005-05-24 10:51:10 UTC
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
Comment 3 Daniel Veillard 2005-05-24 12:15:46 UTC
First thing: update current versions are libxml2 2.6.19 and libxslt-1.1.14
Second try the --nonet option of xsltproc.

Daniel
Comment 4 haui 2005-05-24 14:30:24 UTC
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
Comment 5 haui 2005-05-24 14:37:20 UTC
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">
                                                     ^
Comment 6 André Klapper 2006-09-29 17:41:24 UTC
reopening as requested information has been provided.
haui, do you still face this issue?
Comment 7 Daniel Veillard 2006-09-30 13:51:12 UTC
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
Comment 8 GNOME Infrastructure Team 2021-07-05 11:01:15 UTC
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.