Some different 'XML' file structure read correctly in PHP

dtn2603

New Member
Im trying to load data from this XML;http://pastebin.com/pW0JT2nqGrab, load and store the data to my MySQL database.I believe it's not quite valid XML, firstly. I cannot open the document, as I got:error on line 1 at column 11: AttValue: " or ' expectedon the first line. Found out this was because of type=node should be type="node", so I replaced this everywhere in the file (seemed to be the only solution).Then i got another error was open the document;error on line 12 at column 1: Extra content at the end of the documentI guess this is because of the \[code\]</node>\[/code\] at line 13?I only did the first step:\[code\] $doc = new DOMDocument(); try { $doc = new DOMDocument(); $doc->loadXml(file_get_contents('file.xml')); }catch(Exception $e) { echo $e; }\[/code\]And cannot make it load correctly. What should I do? I dont want to manually edit the file, since there should be lots more of the same xml structure that should be readed by the php script Im going to make.This XML comes from Linkman bookmark manager, if this helps to mention.
 
Back
Top