Problem with XML serialization.
Posted: Mon Jan 18, 2010 12:26 pm
Here is my code.
I am storing xml document in session variable and want to access it on next page in the form of string. I found out PEAR packages so tried it. Now in my line of code, when i call getSerializedData(), I see 'undefined' when alert() xmlHttpResponse.responseText.
Does anyone has any idea where am i going wrong? Any help would be appriciated.
Code: Select all
<?php
session_start();
ini_set("include_path", ini_get('include_path').PATH_SEPARATOR.'./PEAR/'.PATH_SEPARATOR.'./PEAR/PEAR/' );
if( !isset( $_GET["sess"] ) )
{
$xmlstring = file_get_contents("php://input");
$xml = new DOMDocument();
$xml->loadXML($xmlstring);
$_SESSION["xmlData"] = $xmlstring;
}
else
{
require_once("Serializer.php");
echo $_SESSION["xmlData"];
$sr = new XML_Serializer();
$sr->serialize($xml);
echo $sr->getSerializedData();
}
?>Does anyone has any idea where am i going wrong? Any help would be appriciated.