ID: 15845 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Bogus Bug Type: Sablotron XSL Operating System: Linux PHP Version: 4.0.6 New Comment:
when you say "does not need a handle" you wanna say "won't take one", right? and... what version of php uses the new ext/sablot, if this is the old? is the old version documented somewhere? could not find anything... jj Previous Comments: ------------------------------------------------------------------------ [2002-03-03 13:27:54] [EMAIL PROTECTED] This is not a bug. It is intended to work that way. You are using the old ext/sablot and there xslt_process does not need a sablotron processor handle. Please ask further questions on php-general. ------------------------------------------------------------------------ [2002-03-03 11:08:45] [EMAIL PROTECTED] I tried to do some transformations using sablotron and the PHP xslt functions. After running into troubles from the first moment, I tried some example scripts, but all of them won't work. To get an idea of what i did i will post the xml-file content, the xsl-file content and the script... THE XSL FILE ------------------------------------------------------ <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <html> <body> <table border="2" bgcolor="yellow"> <tr> <th>Title</th> <th>Artist</th> </tr> <xsl:for-each select="catalog/cd"> <tr> <td><xsl:value-of select="title"/></td> <td><xsl:value-of select="artist"/></td> </tr> </xsl:for-each> </table> </body> </html> </xsl:template> </xsl:stylesheet> ------------------------------------------------------ THE XML FILE ------------------------------------------------------ <?xml version="1.0" encoding="ISO-8859-1"?> <catalog> <cd> <title>Empire Burlesque</title> <artist>Bob Dylan</artist> <country>USA</country> <company>Columbia</company> <price>10.90</price> <year>1985</year> </cd> </catalog> ------------------------------------------------------ THE SCRIP (taken from the php-online-documentation for xslt_process()) ------------------------------------------------------ <? $xsl = implode('',file("xml/cedists/cedist_news.xsl")); $xml = implode('',file("xml/cedefts/cedeft_news.xml")); // $xml and $xsl contain the XML and XSL data $arguments = array( '/_xml' => $xml, '/_xsl' => $xsl ); // Allocate a new XSLT processor $xh = xslt_create(); // Process the document $result = xslt_process($xh, 'arg:/_xml', 'arg:/_xsl', NULL, $arguments); if ($result) { print "<pre>\n"; print $result; print "</pre>\n"; } else { print xslt_error($xh); print xslt_errno($xh); } xslt_free($xh); ?> ------------------------------------------------------ THE PROBLEM ****************************************************** Running the script produces the following error: "Only variables can be passed by reference" So i tried the following: ................................... $result = xslt_process($xh,$xml,$xsl,NULL,$output); echo $output; ................................... Running the script with this xslt_process line produces the following error: "Wrong parameter count for xslt_process()" So i changed the thing again and again and again until i got a call of xslt_process which worked: ................................... $result = xslt_process($xsl,$xml,$output); echo $output; ................................... As you can see, i DO NOT pass the reference to the created processor ($xh), and i also did not pass the other stuff, and !! the ORDER OF $xsl and $xml WAS CHANGED. This works! But why??? It even works, if i don't use xslt_create() function. Why is that??? The whole xslt_ stuff seems to be a bit tricky... ****************************************************** ADDITIONAL INFORMATION ====================================================== PHP Version 4.0.6 ------------------------------------------------------ Linux Kernel 2.4.16 ------------------------------------------------------'./configure' '--with-apxs=/usr/local/apache/bin/apxs' '--with-mysql=/usr/local/mysql' '--enable-track-vars' '--enable-sysvsem' '--disable-debug' '--enable-ftp' '--enable-bcmath' '--with-gd' '--with-jpeg-dir' '--with-png-dir=/usr/lib' '--with-zlib-dir=/usr/include' '--with-pdflib' '--with-ttf' '--with-ming=/usr/src/ming-0.2a' '--with-imap=/usr/src/imap-4.7c' '--with-swf=/usr/src/dist' '--with-dom' '--with-curl' '--with-sablot' '--enable-memory-limit' ------------------------------------------------------ NO INFORMATION ABOUT SABLOTRON AVAILABLE, BUT SABLTRON HAS BEEN INSTALLED BY THE PROVIDER ON MY REQUEST, SO I THINK IT SHOULD BE THE LATEST VERSION ====================================================== ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=15845&edit=1
