I tried the following code to generate an XML file using php!!
Code:
<?php
$doc= new DOMDocument("1.0");
$node= $doc->createElement('markers');
$parnode= $doc->appendChild($node);
$newnode= $doc->createElement('marker');
$parnode->appendChild($newnode);
header('Content-type:text/xml');
echo $doc->saveXML();
?>
The above code is working fine in my local host XAMPP server. But when I tried it on webhost it is giving me the following error:
"This page contains the following errors:
error on line 5 at column 1: Extra content at the end of the document
Below is a rendering of the page up to the first error."
Can you please tell me Whats wrong with this code?? or why its working on local host but not in webhost??