Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
4.8.0
-
None
Description
below are the test xml and xsl
xml:
<?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="test.xsl"?> <library> <book><name>abc</name></book> <book><name>def</name></book> <book><name>aaa</name></book> </library>
xsl
<?xml version="1.0" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <xsl:for-each select="/library/book"> <xsl:sort select="name" data-type="text" /> <xsl:value-of select="position()" />: <xsl:value-of select="name" /> </xsl:for-each> </xsl:template> </xsl:stylesheet>
With online testtools like 'http://www.xsltcake.com/', you get the proper poistion but with qt it gives old(original indices only). which is wrong.
correct output(with online testtools) 1: aaa 2: abc 3: def
wrong output(with Qt) 3: aaa 1: abc 2: def
I tried same with 'xmlpatterns'(from shell prompt), it gives same wrong result as with Qt Application.
expected:
after sorting, it(position()) should return sequenced indices after sort.