Page 1 of 1

Parse XML using PHP

Posted: Wed Aug 03, 2011 9:26 am
by latika
Hello ,

I know this is trivial but sorry for my ignorance.
I have data in the form of XML.
How to show it inside a report for a php? I tried the following:

$xmlWrite ='';
$xmlWrite .='';
$xmlWrite .='';
$xmlWrite .='';
$xmlWrite .='


Demo
Demo
../reports/Demo.xml
../reports/Demo.xsd

';
$xmlWrite .='

Emplyee

EmplyeeID,System.String
EmplyeeName,System.String
EmployeeTitle,System.String
Phone,System.String


Emplyee
Demo.Emplyee





,Variable1,Variable1,,System.String,Report_x0020_Title,False,False,True


.
.
.
.
.
.
.
.
$xmlWrite .='';
while($row = mysql_fetch_array( $rs ) )
{
$xmlWrite .='';
for($i=0; $i". $row[$i]. "";
}
$xmlWrite .= '';
}
$xmlWrite .= '';
$timestamp = strtotime("now");
$_SESSION['filename'] = $timestamp;
$renameFile = $_SESSION['filename'];
//echo $xmlWrite;
$file = fopen("QuickStart/reports/SimpleList_$renameFile.mrt","x+");
fwrite($file,$xmlWrite);
fclose($file);

And it shows an empty report.

What is the mistake?
And the bigger question is: Where in the document can I find any information about this topic?

I am trying to parse the xml, but still is empty.
what is this
EmplyeeID,System.String
and
{Variable1}

I have wrote the same code like simpleList.mrt in a different page. and only link this page into my pop up window.



Run Report




but it's not working.
Please, help me.

Thanks

Parse XML using PHP

Posted: Fri Aug 05, 2011 3:06 am
by Vladimir
Hello,

Please explain in more detail what you need?
The report and data are loaded separately, the path to the XML data file (relative or absolute) is stored in the MRT report file, it can be set in the designer.

Thank you.