Welcome to WebmasterWorld Guest from 54.146.180.94

Forum Moderators: coopster & jatar k

parsing of huge xml files

parsing of huge xml files

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

5+ Year Member



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.
10:27 am on Jan 5, 2009 (gmt 0)

10+ Year Member



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 ]

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

5+ Year Member



Dear flexi,

You can read it as small chunk in a loop.

Thanks
Mahabub

 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month