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 563393 - embedding stylesheet with xinclude fails
embedding stylesheet with xinclude fails
Status: RESOLVED OBSOLETE
Product: libxml2
Classification: Platform
Component: xinclude
2.6.31
Other Mac OS
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2008-12-05 21:57 UTC by stinney
Modified: 2020-08-17 22:00 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description stinney 2008-12-05 21:57:43 UTC
Given:

<?xml-stylesheet type="text/xml" href="#style1"?>
<doc>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="test.xsl"/>
<head>
</head>
</doc>

and

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xml:id="style1" version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="xsl:stylesheet"/>
<xsl:template match="head"><xsl:message>hello</xsl:message></xsl:template>
</xsl:stylesheet>

I expect that:

 xsltproc --xinclude test.xml

Will process the xinclude first, then find #style1; instead I get:

[cdl@enlil doc]$ xsltproc --xinclude  ~/test.xml 
error: file /home/cdl/test.xml line 1 element xml-stylesheet
xml-stylesheet : no ID style1 found
compilation error: file /home/cdl/test.xml line 2 element doc
xsltParseStylesheetProcess : document is not a stylesheet

I can work around this with:

[cdl@enlil doc]$ xmllint --xinclude ~/test.xml | xsltproc - 
hello
<?xml version="1.0"?>
[cdl@enlil doc]$

I think the xsltproc behaviour is probably incorrect, though.

Thanks,

 Steve
Comment 1 Nick Wellnhofer 2020-08-17 22:00:37 UTC
This is tracked in the new bug tracker as issue #3:

https://gitlab.gnome.org/GNOME/libxslt/-/issues/3