homepage Welcome to WebmasterWorld Guest from 54.211.201.65
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
parsing of huge xml files
parsing of huge xml files
flexi




msg:3819358
 9:32 am on Jan 5, 2009 (gmt 0)

I have a large xml file(around 50mb).I have tried many xml parsing codes
but all give me memory error.
I have even changed the memory limit to 256mb and above using ini_set command,but in vain.
I need a memory efficient parser.Could you please help me.

 

Mike12345




msg:3819375
 10:27 am on Jan 5, 2009 (gmt 0)

If you are using a pre-written script you may find it is putting everything from the xml into an array. For an xml file this size that might be what's leading to your memory problem. Modify it to only store the data you need and see if that helps.

Also, try using a stream-oriented method this should be much more memory efficient. Use XML Parser in php, documentation can be found here: [uk.php.net ]

Mahabub




msg:3819404
 12:16 pm on Jan 5, 2009 (gmt 0)

Dear flexi,

You can read it as small chunk in a loop.

Thanks
Mahabub

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved