Wrong conflict resolution for template rules
This bug was migrated from bugzilla.gnome.org (bug 533334)
xsltproc produces wrong output, because of the wrong conflict resolution for template rules.
Steps to reproduce:
- Stylesheet
<?xml version="1.0" encoding="UTF-8"?>
<!-- transformation of the calloutlist element -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="text()">
</xsl:template>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
- XML file
<?xml version="1.0" encoding="UTF-8"?>
<winelist>
<wine grape="Chardonnay">
<winery>Benziger</winery>
<product>Carneros</product>
</wine>
</winelist>
- Run xsltproc with the stylesheet and the XML file:
xsltproc in.xslt in.xml
Actual xsltproc's output is
<?xml version="1.0"?>
<winelist>
<wine>
<winery/>
<product/>
</wine>
</winelist>
Expected xsltproc's output is
<?xml version="1.0" encoding="UTF-8"?>
<winelist>
<wine>
<winery>Benziger</winery>
<product>Carneros</product>
</wine>
</winelist>
This happens every time.
I use libxslt 1.1.34
The described behavior of the xsltproc violates the conflict resolution rule described in the last paragraph of the Chapter 5.5 in the XSL Transformations W3C Specification.
I have tested the same Stylesheet and XML file with xalanj and 4xslt. Both produce the expected correct output.