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 598624 - XSLT does not resolve relative URLs correctly when using HTMLParser
XSLT does not resolve relative URLs correctly when using HTMLParser
Status: RESOLVED OBSOLETE
Product: libxml2
Classification: Platform
Component: htmlparser
git master
Other Mac OS
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2009-10-15 22:20 UTC by Laurence Rowe
Modified: 2021-07-05 13:21 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Laurence Rowe 2009-10-15 22:20:52 UTC
The second parameter of function document( 'path', . ) is node-set used to resolve relative URLs. When loading an external document using the XMLParser, this works as expected:

$ xsltproc --load-trace test.xsl scratch/doc.html 
Loaded URL="test.xsl" ID="(null)"
Loaded URL="scratch/doc.html" ID="(null)"
warning: failed to load external entity "scratch/path"

However, when using the HTMLParser, the relative url is not being calculated:

$ xsltproc --load-trace --html test.xsl scratch/doc.html 
Loaded URL="test.xsl" ID="(null)"
Loaded URL="scratch/doc.html" ID="(null)"
warning: failed to load external entity "path"

Here are the source documents used above:

$ cat test.xsl 
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:template match="/">
        <xsl:copy-of select="document('path', . )"/>
    </xsl:template>
</xsl:stylesheet>

$ cat scratch/doc.html 
<html><body>content</body></html>

And the versions:

$ xsltproc --version
Using libxml 20703-SVN3827, libxslt 10124-SVN1494 and libexslt 813
xsltproc was compiled against libxml 20703, libxslt 10124 and libexslt 813
libxslt 10124 was compiled against libxml 20703
libexslt 813 was compiled against libxml 20703

I see the same problem when doing this through python lxml.
Comment 1 GNOME Infrastructure Team 2021-07-05 13:21:31 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/libxml2/-/issues/

Thank you for your understanding and your help.