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 602515 - match="text[2]" fails, "text[1]" and "_text[2]" work fine
match="text[2]" fails, "text[1]" and "_text[2]" work fine
Status: RESOLVED FIXED
Product: libxslt
Classification: Platform
Component: general
1.1.x
Other Linux
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2009-11-20 17:38 UTC by Noam
Modified: 2010-02-26 22:39 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Noam 2009-11-20 17:38:53 UTC
Given the following xml document:

<root>
  <text>one</text>
  <text>two</text>
</root>

and the following xsl file:

<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="text[2]">
    <xsl:value-of select="."/>
  </xsl:template>

  <xsl:template match="text()"/>
</xsl:transform>

xsltproc gives no output at all. Changing the <text> tags to <_text> (and the match to "_text[2]") gives 

<?xml version="1.0"?>
two

as I expect. Matching "text[1]" gives

<?xml version="1.0"?>
one


$ xsltproc --version
Using libxml 20706, libxslt 10126-GITv1.1.26-1-ga1981a0 and libexslt 815
xsltproc was compiled against libxml 20706, libxslt 10126 and libexslt 815
libxslt 10126 was compiled against libxml 20706
libexslt 815 was compiled against libxml 20706
Comment 1 Nick Wellnhofer 2009-12-29 18:24:26 UTC
You can find a fix for this bug in my repository on github:

http://github.com/nwellnhof/libxslt/commit/a9ef378d30703b9d760fb56447ef110154d9a3fe