ID: 25644
Updated by: [EMAIL PROTECTED]
Reported By: sparky_industries at mad dot scientist dot com
-Status: Open
+Status: Feedback
Bug Type: XSLT related
Operating System: Windows 98
PHP Version: 4.3.3
New Comment:
Add the php script here too.
Previous Comments:
------------------------------------------------------------------------
[2003-09-24 09:13:44] sparky_industries at mad dot scientist dot com
Description:
------------
if i want to xsl:sort the elements of xsl:for-each and set data-type to
'text' (or drop data-type, which is the same), php crashes (windows
error-popup)!
Reproduce code:
---------------
XML:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<names>
<name>hansi</name>
<name>bergi</name>
<name>krabi</name>
<name>tali</name>
</names>
</root>
XSL:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/root">
<xsl:apply-templates select="names" />
</xsl:template>
<xsl:template match="names">
<xsl:for-each select="name">
<xsl:sort select="." order="descending" data-type="text" />
<xsl:value-of select="." />
<br />
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Expected result:
----------------
tali<br />
krabi<br />
hansi<br />
bergi<br />
Actual result:
--------------
PHP crashes ...
if i exclude the xsl:sort instruction, it works !
it also works, when data-type="number" (this makes no sense here), but
if i drop it, or set data-type="text" php crashes
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=25644&edit=1