When I use the below code and parse the xml locally it works fine but when upload the same script at the server it shows error.
Note: I retrieved the $lng
On each loop of the result set, you're appending a new root element to the document, creating an XML document like this:
...
...
...
An XML document can only have one root element, which is why the error is stating there is "extra content". Create a single root element and add all the mycatch elements to that:
$root = $dom->createElement("root");
$dom->appendChild($root);
// ...
while ($row = @mysql_fetch_assoc($result)){
$node = $dom->createElement("mycatch");
$root->appendChild($node);