Activity log for bug #722343

Date Who What changed Old value New value Message
2011-02-20 21:48:36 Christian Assig bug added bug
2011-02-20 21:52:25 Christian Assig description I'm using libxslt and xsltproc 1.1.26-6 in Ubuntu maverick. When I use xsltproc with the following XML document: <?xml version="1.0" encoding="utf-8"?> <root> <a> <b reference="1"/> </a> <c id="1" /> </root> and the following XSLT transformation: <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:key name="key-test" match="*" use="@id" /> <xsl:key name="key-test" match="*" use="@reference" /> <xsl:template match="/"> <xsl:copy-of select="key('key-test', '1')[1]" /> <xsl:copy-of select="key('key-test', '1')" /> </xsl:template> </xsl:transform> the output is: <?xml version="1.0"?> <c id="1"/><b reference="1"/><c id="1"/> So in this case, key('key-test', '1')[1] returns a node (c in this case) that is not the first node that is returned when using key('key-test', '1') (this returns b followed by c). I've tried Saxon 9.3.0.4 and the SAP XSLT Processor, and both returned what I would have expected: <?xml version="1.0"?> <b reference="1"/><b reference="1"/><c id="1"/> I have also noticed that changing the order of the two xsl:key elements in my transformation changes the result of key('key-test', '1')[1] in xsltproc, while key('key-test', '1') stays the same. In both Saxon and the SAP XSLT Processor, the order of the elements does not have any influence on the output. As both Saxon and the SAP XSLT Processor behave the way I would have expected, and xsltproc does not, I assume there is something wrong with xsltproc. I'm using libxslt and xsltproc 1.1.26-6 in Ubuntu maverick. When I use xsltproc with the following XML document: <?xml version="1.0" encoding="utf-8"?> <root>   <a>     <b reference="1"/>   </a>   <c id="1" /> </root> and the following XSLT transformation: <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">   <xsl:key name="key-test" match="*" use="@id" />  <xsl:key name="key-test" match="*" use="@reference" />   <xsl:template match="/">    <xsl:copy-of select="key('key-test', '1')[1]" />   <xsl:copy-of select="key('key-test', '1')" />   </xsl:template> </xsl:transform> the output is: <?xml version="1.0"?> <c id="1"/><b reference="1"/><c id="1"/> So in this case, key('key-test', '1')[1] returns a node (c in this case) that is not the first node that is returned when using key('key-test', '1') (this returns b followed by c). I've tried Saxon 9.3.0.4 and the SAP XSLT Processor, and both returned what I would have expected: <?xml version="1.0"?> <b reference="1"/><b reference="1"/><c id="1"/> I have also noticed that changing the order of the two xsl:key elements in my transformation changes the result of key('key-test', '1')[1] in xsltproc, while key('key-test', '1') stays the same. In both Saxon and the SAP XSLT Processor, the order of the elements does not have any influence on the output. As both Saxon and the SAP XSLT Processor behave the way I would have expected, and xsltproc does not, I assume there is something wrong with xsltproc. Edit: XSLT transformation was not indented properly.
2011-02-20 21:54:00 Christian Assig description I'm using libxslt and xsltproc 1.1.26-6 in Ubuntu maverick. When I use xsltproc with the following XML document: <?xml version="1.0" encoding="utf-8"?> <root>   <a>     <b reference="1"/>   </a>   <c id="1" /> </root> and the following XSLT transformation: <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">   <xsl:key name="key-test" match="*" use="@id" />  <xsl:key name="key-test" match="*" use="@reference" />   <xsl:template match="/">    <xsl:copy-of select="key('key-test', '1')[1]" />   <xsl:copy-of select="key('key-test', '1')" />   </xsl:template> </xsl:transform> the output is: <?xml version="1.0"?> <c id="1"/><b reference="1"/><c id="1"/> So in this case, key('key-test', '1')[1] returns a node (c in this case) that is not the first node that is returned when using key('key-test', '1') (this returns b followed by c). I've tried Saxon 9.3.0.4 and the SAP XSLT Processor, and both returned what I would have expected: <?xml version="1.0"?> <b reference="1"/><b reference="1"/><c id="1"/> I have also noticed that changing the order of the two xsl:key elements in my transformation changes the result of key('key-test', '1')[1] in xsltproc, while key('key-test', '1') stays the same. In both Saxon and the SAP XSLT Processor, the order of the elements does not have any influence on the output. As both Saxon and the SAP XSLT Processor behave the way I would have expected, and xsltproc does not, I assume there is something wrong with xsltproc. Edit: XSLT transformation was not indented properly. I'm using libxslt and xsltproc 1.1.26-6 in Ubuntu maverick. When I use xsltproc with the following XML document: <?xml version="1.0" encoding="utf-8"?> <root>   <a>     <b reference="1"/>   </a>   <c id="1" /> </root> and the following XSLT transformation: <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">   <xsl:key name="key-test" match="*" use="@id" />   <xsl:key name="key-test" match="*" use="@reference" />   <xsl:template match="/"> <xsl:copy-of select="key('key-test', '1')[1]" /> <xsl:copy-of select="key('key-test', '1')" />   </xsl:template> </xsl:transform> the output is: <?xml version="1.0"?> <c id="1"/><b reference="1"/><c id="1"/> So in this case, key('key-test', '1')[1] returns a node (c in this case) that is not the first node that is returned when using key('key-test', '1') (this returns b followed by c). I've tried Saxon 9.3.0.4 and the SAP XSLT Processor, and both returned what I would have expected: <?xml version="1.0"?> <b reference="1"/><b reference="1"/><c id="1"/> I have also noticed that changing the order of the two xsl:key elements in my transformation changes the result of key('key-test', '1')[1] in xsltproc, while key('key-test', '1') stays the same. In both Saxon and the SAP XSLT Processor, the order of the elements does not have any influence on the output. As both Saxon and the SAP XSLT Processor behave the way I would have expected, and xsltproc does not, I assume there is something wrong with xsltproc. Edit: XSLT transformation was not indented properly.