PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi
I have a XML file which is way too big to parser ( 417MB ) so i`m wanting to create a class so i can return the values of a given search.
so say the XML was:
[syntax="xml"]
<houses>
<house>
<code>PT1234</code>
<rooms>3</rooms>
<price>100000</price>
</house>
<house>
<code>ABCD12</code>
<rooms>7</rooms>
<price>200000</price>
</house>
<house>
<code>XYZ12</code>
<rooms>1</rooms>
<price>50000</price>
</house>
<house>
<code>PYT122</code>
<rooms>6</rooms>
<price>56000</price>
</house>
</houses>
Would it be possible to return all the node information for a given search, so for example:[/syntax]
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
don't use xpath with simplexml, unless you want to give php a memory limit of really massive. sax (xml parser in php) allows you to parse a file in chucks loading a certain number of bytes at a time. It will be slow though.
As the XML has a very simple structure you should put this in a database as soon as you can.