GNOME Bugzilla – Bug 563393
embedding stylesheet with xinclude fails
Last modified: 2020-08-17 22:00:37 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
This is tracked in the new bug tracker as issue #3: https://gitlab.gnome.org/GNOME/libxslt/-/issues/3