Quote:
|
Originally Posted by mark87
...Now, there'll be many events; ...in date order.
Any ideas on how to do this?
|
yes , don't use XML use a database

,
... ok I just read the other thread and see that is not an option, so while XML is fine for storage it is not (even with Xpath (simpleXML in PHP5 etc)) a good medium to search and query especially with say hundreds of records.
I would suggest 1 XML file per item and keep another index file (you are now creating a database

) with either XML if you must or much faster PHP arrays of indexes , you can keep that index in date order and even with a few hundred entries it wont be too much work for PHP to load and mung..
(ksort() is your friend here)
e.g. in the below array '1' would relate to article /blah/1.xml dated 2006/jan/10 ( I like that YYYYMMDD timestamp format since its easy to perform simple greater than or less than logic on it)
PHP Code:
<?php
$idx=array(20060110=>1,20060111=>2,'etc');
?>
OK now you probably have to include multiple XML files which is in itself not the most efficient way to go about it but I think far better than parsing a ?kb XML file.