XML parsing bit at a time

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!

Moderator: General Moderators

Post Reply
leenoble_uk
Forum Contributor
Posts: 108
Joined: Fri May 03, 2002 10:33 am
Location: Cheshire
Contact:

XML parsing bit at a time

Post by leenoble_uk »

Through some of the links on this forum I found the XML parsing script by Keith Davens.
Being short on time I have incorporated it into my site. Once everything is in an array using the XML_unserialize function I can manipulate the data for pagination and search purposes.
I just finished up all my processing code and it all works exactly as it should using the XML document that my client supplied.
Today I got the latest version of the document, only this time it weighs in at nearly 6Mb and none of my pages work any more.
The data structure is identical, there's just too much of it now.

Code: Select all

<?
	$rawXML = file_get_contents("./xmldata/13Aug2004_CDE.xml");
// echo $rawXML; //this contains all the file data and is confirmed to be correct
	$dataArray = XML_unserialize($rawXML);
// this does not work any more.
?>
Ultimately I need to search for a particular code in each entry and paginate the results, 10 per page.
I just don't know how to get all the data into one array any more or if 6Mb is considered too large to do this kind of thing to anyway, and if so how to get around the limitation.
Post Reply