GNOME Bugzilla – Bug 377432
self::name should never match an attribute
Last modified: 2006-11-23 16:09:10 UTC
Please describe the problem: The principal node type of the "self" axis is element, so self::name should never match an attribute. Steps to reproduce: 1. Create an identity stylesheet 2. Add the template <xsl:template match="@*[self::att]"/> 3. Apply it to a document containing an attribute named "att" Actual results: The "att" attribute is deleted Expected results: The document should be unchanged Does this happen every time? Yes Other information:
Okay I found where the bug was hiding, in libxml2 XPath module actually Now fixed in CVS: paphio:~/XSLT/xsltproc -> cat identity.xsl <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <!-- XSLT REC section 7.5 --> <xsl:output method="xml"/> <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> <xsl:template match="@*[self::att]"/> </xsl:stylesheet> paphio:~/XSLT/xsltproc -> xsltproc identity.xsl test.xml <?xml version="1.0"?> <foo att="bar"/> paphio:~/XSLT/xsltproc -> thanks ! Daniel