GNOME Bugzilla – Bug 354900
text copy failed with XInclude
Last modified: 2007-01-11 17:53:22 UTC
Please describe the problem: libxml, xsltproc from CVS of 8 September 2006. 1) I get the following error [screen] $ xsltproc -o doc.html --xinclude test.xsl doc.xml runtime error: file doc.xml element text xsltDefaultProcessOneNode: text copy failed error: file doc.xml xsltRunStylesheet : run failed [/screen] when using near-identity transformation [test.xsl] <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <!-- --> <xsl:template match="*"> <xsl:copy> <xsl:copy-of select="@*"/> <xsl:apply-templates/> </xsl:copy> </xsl:template> </xsl:stylesheet> [/test.xsl] for the following XML files: [doc.xml] <doc> <xi:include href="inc.xml" xpointer="xpointer(/subdoc/sect[@id='id1']/range-to(following::sect[@id='id2']/node()[last()]))" xmlns:xi="http://www.w3.org/2001/XInclude"/> </doc> [/doc.xml] [inc.xml] <subdoc> <sect id="id1">lalala</sect> <sect id="id2">lalala</sect> </subdoc> [/inc.xml] 2) Pre-running xnllint gives no error: xmllint --xinclude doc.xml >x.xml xsltproc -o doc.html --xinclude test.xsl x.xml Steps to reproduce: Actual results: Expected results: Does this happen every time? Other information:
This was actually caused by an empty text node being produced by XInclude (i.e. libxml2-related). I have modified libxslt (transform.c) to accept and ignore it. Thanks for the report.