ayok Posted March 5, 2012 Share Posted March 5, 2012 Hi, I am busy creating a site which display product list from XML (rss feeds) files. In the first phase I can do a method by saving all the data's from XML into my database, and display it from database. However, this time, I need to display it directly without saving it to my database because there are a lot more data's in the second phase. So I need to display the data's directly from the XML's. I've tried several methods like using SimpleXML, it works nice, however, it can't handle larger XML (like 800 MB). So I tried other method like SAX or XMLReader. Both work like a charm. It can even parsing GB's XML and display all the data's. However, I need to create query or manipulate the xml to display those data's, like only display certain category or search. Then I got again the same problem with time limited error or sometimes size exceeded error. I don't know what to do now. Does anybody have advice how I should do this? Thank you, ayok Quote Link to comment https://forums.phpfreaks.com/topic/258324-handle-large-xml-file/ Share on other sites More sharing options...
RobertP Posted March 5, 2012 Share Posted March 5, 2012 IMO you should parse the xml and add to some kind of database. if you parse the xml for each page load, especially with the file size you are describing, you will lag like a mother fucker.. Quote Link to comment https://forums.phpfreaks.com/topic/258324-handle-large-xml-file/#findComment-1324220 Share on other sites More sharing options...
ignace Posted March 5, 2012 Share Posted March 5, 2012 I agree with RobertP, use a database. Optimize your queries with indexes. Quote Link to comment https://forums.phpfreaks.com/topic/258324-handle-large-xml-file/#findComment-1324233 Share on other sites More sharing options...
ayok Posted March 5, 2012 Author Share Posted March 5, 2012 What kind of database? I use mysql and there are like hundred thousands items, is this going to be fine? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/258324-handle-large-xml-file/#findComment-1324235 Share on other sites More sharing options...
ignace Posted March 5, 2012 Share Posted March 5, 2012 MySQL will do just fine. Just be sure to define proper indexes. Quote Link to comment https://forums.phpfreaks.com/topic/258324-handle-large-xml-file/#findComment-1324267 Share on other sites More sharing options...
ayok Posted March 6, 2012 Author Share Posted March 6, 2012 Ok thanks, I'll try this way.. Quote Link to comment https://forums.phpfreaks.com/topic/258324-handle-large-xml-file/#findComment-1324563 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.