|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-02-09 07:50 UTC] p dot vangils at mycoweb dot nl
I used <xsl: sort select="number"> in my xsl file. I used an empty tag <number></number> in my xml file. I understand that sorting on an empty xml tag is very difficult but i didn't expect the xslt_process function to hang. Of course where <number></number> is filled in everything works fine. It should be better to give an error or place the empty tags in the beginning or in the end. Hangup cost server performance i think. With kind regards, Paul van Gils PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 07:00:01 2025 UTC |
Thanks for your reply. I made a script to reproduce the problem. On php version 4.2.1 on windows it works fine. On php version 4.3.0 on linux it will hang. With kind regards, Paul van Gils <?php $xml="<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>". "<articlelist>". "<articles>". "<article>". "<text1>Hello world!</text1>". "<number></number>". "</article>". "</articles>". "</articlelist>"; $xsl="<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n". "<xsl:stylesheet version=\"1.0\"\n". "xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"\n". "xmlns:fo=\"http://www.w3.org/1999/XSL/Format\">\n". "<xsl:output method=\"html\"/>\n". "<xsl:template match=\"/\">\n". "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n". "<xsl:for-each select=\"articlelist/articles/article\">\n". "<xsl:sort select=\"number\"/>\n". "<tr>\n". "<td valign='top'>\n". "Hello world!\n". "</td>\n". "</tr>\n". "</xsl:for-each>\n". "</table>\n". "</xsl:template>\n". "</xsl:stylesheet>\n"; // $xml and $xsl contain the XML and XSL data $arguments = array( '/_xml' => $xml, '/_xsl' => $xsl ); // Allocate a new XSLT processor $xh = xslt_create(); $result = xslt_process($xh, 'arg:/_xml', 'arg:/_xsl', NULL, $arguments); echo "<html><body>Gereed</body></html>"; ?>