You are here: Re: split large xml files « PHP Programming Language « IT news, forums, messages
Re: split large xml files

Posted by Cristian Cotovan on 08/10/07 18:23

On Aug 10, 2:34 am, "Bob Bedford" <b...@bedford.com> wrote:
> > $xml = simplexml_load_file($xmlFile);
> > And take it from there. Have a quick read of the simplexml docs. You
> > should
> > have your solution in very little time.
>
> Thanks for replying....
> after a quick search, I've to say I'm still in PHP 4 !!! damn !!!

If you have files that big, simple xml is not an option, because the
memory will run out, and simple xml reads the whole file in memory and
makes a copy of it. What you really want is xml parsing in "streaming"
or "pull parsing" mode. You can read about it here:

http://www.ibm.com/developerworks/xml/library/x-pullparsingphp.html?ca=dgr-lnxw06XMLReader

However, I guess this is also not very helpful since you're running
PHP 4 and XMLReader has been introduced in PHP5. I am fighting this at
this moment also (with no solution yet), as I have to parse huge ONIX
files from book publishers (some are 90 Mb!). Let me know if you get
lucky.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация