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:

no, i don't think so, i have downloaded the new version (4.3.3) of php
(windows zip package) with all the extensions, so this can not be the
problem.

furthermore, i use the same apache2, the same php package and the same
explorer on another machine running windows xp ... and it works!
everything is completely the same, except the operating system ...
(maybe windows 98 is really too old ;)


Previous Comments:
------------------------------------------------------------------------

[2003-09-24 19:48:43] [EMAIL PROTECTED]

Works fine in Linux too. Are you sure you just don't have some old xslt
related dll in your win98 machine?


------------------------------------------------------------------------

[2003-09-24 16:13:10] sparky_industries at mad dot scientist dot com

Operating System:

i tried the same script (same configuration of apache2 and php) on
windows XP - IT WORKES !!!

so it has to do something with the operating system!

------------------------------------------------------------------------

[2003-09-24 16:11:19] sparky_industries at mad dot scientist dot com

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);

------------------------------------------------------------------------

[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

Reply via email to