Jump to content

problem with storing xml in a DOM object


Pesho

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.