Pesho Posted April 20, 2007 Share Posted April 20, 2007 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=ListRecords&metadataPrefix=oai_dc my code is the following: $dom = new DomDocument(); $dom->loadXML($xml_content); print $dom->save('newfile.xml'); The output file contains only one line - "<?xml version="1.0"?>" Here are the warnings I receive: 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 thanks in advance, Pesho Link to comment https://forums.phpfreaks.com/topic/47880-problem-with-storing-xml-in-a-dom-object/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.