PDA

View Full Version : loadXML() error with AMFPHP 1.2/1.9


antonmills
07-15-2007, 10:57 AM
Hey all,
Having some issues while trying to export xml data from flash and creating a domdocument and saving it with AMFPHP. The service browser always points to the line featuring the loadXML() function.

Service browser error:
description DOMDocument::loadXML(): Start tag expected, '<' not found in Entity, line: 1
details /lalala/services/finalproject/xmlsaver.php
level Unknown error type
line 30
code AMFPHP_RUNTIME_ERROR

amfphp file:
<?php
class xmlsaver
{
function xmlsaver()
{
$this->methodTable = array
(
"srv1" => array
(
"access" => "remote",
"description" => "Saves an XML string to a file on server"
)
);
}

function srv1($xmlstr, $filename)
{
// create the xml object and save
$doc = new DomDocument("1.0");

// pritty output pwlease
$mydom->formatOutput = true;

// possible fix read at: http://arulprasad.blogspot.com/2006_06_01_archive.html
// but doesnt work anyway
//$xml = stripSlashes($xmlstr);
//$doc->loadXML($xml);

// so i use this to load the xml string but it fails?!
$doc->loadXML($xmlstr);


// sets output encoding
$doc->encoding="iso-8859-1";

// save the xml document
$doc->saveXML($filename.".xml");
}

}
?>

I've used numerous strings, and substituted load for loadXML() to no avail. Using the same string hardcoded with the loadXML() function in a non-AMFPHP file gives no errors and works as expected.

Just to confirm I havent even touched flash yet this is all tested in the service browser!

Any idea's?

LOLFlash
07-15-2007, 04:57 PM
amfphp I think like connector to database, why not create table with two columns( link - varhar )and (data - Text ) and save it there.

antonmills
07-15-2007, 06:46 PM
designing an installation piece with no internet at the terminal, so didn't really want to use mySQL. It's no probs if i have to use loadvars to save the data, I just would have preferred it if I could get the xml saved with remoting.

Thanks anyway :D
ant.

LOLFlash
07-15-2007, 07:32 PM
I don’t think there are any sense to use amfphp without database. You are involving whole bunch of php scripts to do job what actually one page can do. You are converting XML in flash object with remoting class in Flash and after decompiling it on server side back to XML. Is it easy way: to use XMLConnector in Flash and XMLDocument on server side?