ID: 25644 User updated by: sparky_industries at mad dot scientist dot com Reported By: sparky_industries at mad dot scientist dot com -Status: Feedback +Status: Open Bug Type: XSLT related Operating System: Windows 98 PHP Version: 4.3.3 New Comment:
according to "php script": i would like to add the php script, but it is totally integrated into a big framework, so it would not make sense to extract a few code-lines. but it works like that: $xml = function-to-generate-xml-document(); // xml-document is both WELLFORMED and VALID, i really checked that! $xsl = implode("", file($xslfile)); $arguments = array ( "/_xml" => $xml, "/_xsl" => $xsl ); $xh = xslt_create(); @xslt_set_base($xh, "file://" . $valid_base); // the base is set to the directory of the xsl_file $xml = @xslt_process($xh, "arg:/_xml", "arg:/_xsl", NULL, $arguments); Previous Comments: ------------------------------------------------------------------------ [2003-09-24 09:41:38] [EMAIL PROTECTED] Add the php script here too. ------------------------------------------------------------------------ [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