php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25076 xslt not returning results when called within class that is stored in a session
Submitted: 2003-08-13 10:06 UTC Modified: 2003-08-13 11:02 UTC
From: teddy4you21 at hotmail dot com Assigned:
Status: Not a bug Package: XSLT related
PHP Version: 4.3.2 OS: WindowsXP
Private report: No CVE-ID: None
 [2003-08-13 10:06 UTC] 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..

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-08-13 10:10 UTC] 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 11:02 UTC] msopacua@php.net
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
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 10 23:01:30 2024 UTC