Problem with loading into a DOM object
Posted: Fri Apr 20, 2007 8:50 am
Hi all,
I'm trying to load a xml content string into a DOM object, using PHP5.
the string could be found here: http://ir.ub.rug.nl/oai/?verb=ListRecor ... fix=oai_dc
my code is the following:
The output file contains only one line - "<?xml version="1.0"?>"
Here are the warnings I receive:
Code:
I'm trying to load a xml content string into a DOM object, using PHP5.
the string could be found here: http://ir.ub.rug.nl/oai/?verb=ListRecor ... fix=oai_dc
my code is the following:
Code: Select all
$dom = new DomDocument();
$dom->loadXML($xml_content);
print $dom->save('newfile.xml');Here are the warnings I receive:
Code:
Code: Select all
Warning: DOMDocument::loadXML() [function.loadXML]: XML declaration allowed only at the start of the document in Entity, line: 1 in C:\PHP\www\GuidedResearchProject\formatConversion.php on line 41
Warning: DOMDocument::loadXML() [function.loadXML]: XML declaration allowed only at the start of the document in Entity, line: 1387 in C:\PHP\www\GuidedResearchProject\formatConversion.php on line 41
Warning: DOMDocument::loadXML() [function.loadXML]: XML declaration allowed only at the start of the document in Entity, line: 2887 in C:\PHP\www\GuidedResearchProject\formatConversion.php on line 41
Warning: DOMDocument::loadXML() [function.loadXML]: XML declaration allowed only at the start of the document in Entity, line: 4325 in C:\PHP\www\GuidedResearchProject\formatConversion.php on line 41
22