#25076 [Opn->Bgs]: xslt not returning results when called within class that is stored in a session

From: Date: Wed, 13 Aug 2003 16:02:08 +0000
Subject: #25076 [Opn->Bgs]: xslt not returning results when called within class that is stored in a session
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-45860@lists.php.net to get a copy of this message
ID: 25076 Updated by: msopacua@php.net Reported By: teddy4you21 at hotmail dot com -Status: Open +Status: Bogus Bug Type: XSLT related Operating System: WindowsXP PHP Version: 4.3.2 New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php http://www.php.net/manual/en/language.oop.magic-functions.php Previous Comments: ------------------------------------------------------------------------ [2003-08-13 10:10:43] teddy4you21 at hotmail dot com Note: if I recreate the mxml object on every page, I also get the results. But I want to reuse the same object each time.. ------------------------------------------------------------------------ [2003-08-13 10:06:03] teddy4you21 at hotmail dot com Description: ------------ Hi, in first instance the code works perfect, I get the results with xslt layout. But when I place the class mxml in a session, nothing is returned. Besides, the xlst processor does not return any error. The code is included on top of every webpage. when calling processXMLData($vXML, $vXSL), $vXML is real xml data, while $vXSL is just an url to the XSL document. with kind regards Kris Reproduce code: --------------- class mxml { var $xh; function mxml() { $this->xh = xslt_create(); } function processXMLData($vXML, $vXSL) { $arguments = array('/_xml' => $vXML); $result = xslt_process($this->xh, 'arg:/_xml', $vXSL, NULL, $arguments); if ($result) return $result; else return "<h2>no results were returned</h2>"; } function stopXML() { xslt_free($this->xh); } } // called on every page function startsession() { global $mxml; ob_end_clean(); ob_start(); session_start(); if(session_is_registered("mxml")) $mxml = &$_SESSION["mxml"]; else { $mxml = new mxml(); session_register("mxml"); } } startsession() Expected result: ---------------- a html table with the rows comming from a MySql database Actual result: -------------- no results are returned by the xslt processor, thus no html table.. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=25076&edit=1

« previous php.bugs (#45860) next »