jini01 Posted February 20, 2007 Share Posted February 20, 2007 Hello, I am working for a client that recieves xml files 5 megs to 1700 megs. I need an XML parser that is the best. Any suggestions ? Im thinking a SAX parser. Im kind of new to this so if you could give some deatiled hints, I would greatly appreciate that. Link to comment https://forums.phpfreaks.com/topic/39272-need-some-xml-strategy-here/ Share on other sites More sharing options...
monk.e.boy Posted February 20, 2007 Share Posted February 20, 2007 Erm, use a real programming language? 1,700 megs of XML?!?! WTF!! monk.e.boy Link to comment https://forums.phpfreaks.com/topic/39272-need-some-xml-strategy-here/#findComment-189332 Share on other sites More sharing options...
monk.e.boy Posted February 20, 2007 Share Posted February 20, 2007 Sorry, that was a bit unhelpful What you need is something that reads XML as a stream (like C#, or perl) so it only reads a bit, processes it and so on. Reading 1,700 meg into memory isn't happening in PHP. Or a pre-process that looks at the XML and does something with it before your PHP is called. monk.e.boy Link to comment https://forums.phpfreaks.com/topic/39272-need-some-xml-strategy-here/#findComment-189335 Share on other sites More sharing options...
effigy Posted February 20, 2007 Share Posted February 20, 2007 Should I use SAX or DOM? In short: Use SAX unless you require the hierarchy for XPath. If you have to use DOM, see if you can break the XML document into smaller pieces. Have you looked at PHP's XML capabilities? Also check PEAR. If you have the option to use Perl, XML::Twig is very handy. Link to comment https://forums.phpfreaks.com/topic/39272-need-some-xml-strategy-here/#findComment-189548 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.