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?
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?