GNOME Bugzilla – Bug 602515
match="text[2]" fails, "text[1]" and "_text[2]" work fine
Last modified: 2010-02-26 22:39:58 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
You can find a fix for this bug in my repository on github: http://github.com/nwellnhof/libxslt/commit/a9ef378d30703b9d760fb56447ef110154d9a3fe