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 377432 - self::name should never match an attribute
self::name should never match an attribute
Status: RESOLVED FIXED
Product: libxml2
Classification: Platform
Component: general
2.6.x
Other All
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2006-11-20 16:29 UTC by Richard Tobin
Modified: 2006-11-23 16:09 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Richard Tobin 2006-11-20 16:29:00 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:
Comment 1 Daniel Veillard 2006-11-23 16:09:10 UTC
 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