[xml] forward-slashes being removed from URL "file:///" prefix
- From: Alf Eaton <eaton alf gmail com>
- To: xml gnome org
- Subject: [xml] forward-slashes being removed from URL "file:///" prefix
- Date: Fri, 3 Jul 2015 16:49:01 +0100
Somewhere between libxml 2.9.0 and 2.9.2, possibly at the commit referenced in a previous discussion[1], forward slashes started to be removed from resolved relative URLs, changing a "file:///" prefix to "file:/".
This makes PHP's DOMDocument (which uses libxml) throw an error when loading an entity, as it's now given a URL with a "file:/" (single forward slash) prefix.
This will succeed:
DOMDocument::load('file:///path/to/some/file.xml');
and this will fail:
DOMDocument::load('file:/path/to/some/file.xml');
In my case, I have a catalog file that references DTD files using a relative path:
<rewriteURI uriStartString="http://jats.nlm.nih.gov/" rewritePrefix="jats/"/>
This used to convert
to
file:///opt/schema/jats/publishing/1.0/JATS-journalpublishing1.dtd
but now it gets converted to
file:/opt/schema/jats/publishing/1.0/JATS-journalpublishing1.dtd
and PHP throws an error:
DOMDocument::loadXML(): failed to load external entity "file:/opt/schema/jats/publishing/1.0/JATS-journalpublishing1.dtd"
A system using PHP built against libxml 2.9.0 doesn't have this problem, but a system using PHP built against libxml 2.9.2 does.
Should I report this as a bug?
Alf
[Date Prev][
Date Next] [Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]