Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
01-22-2014, 09:06 AM #1
- Join Date
- Jan 2014
- Thanked 0 Times in 0 Posts
Xpath or SAX for this specific project
I am working on a project where keywords (submitted from a website) will query a large XML document for matching criteria (for shopping products), then retrieve and return all the relevant search results (much like Google Shopping). There may be 100ís of search results returned, with 20 search results per page.
Using PHP for the API call, would XPATH or SAX be better with regard to page loading speed and memory efficiency.
01-22-2014, 01:34 PM #2
- Join Date
- Sep 2002
- Saskatoon, Saskatchewan
- Thanked 2,659 Times in 2,628 Posts
With hundreds of entries, SAX sounds like the route to go to me. DOM could handle this, but it would depend on the size of each entry to whether the memory would be a burden. Newer versions of PHP default to 128MB of memory, which is a far cry from the 8MB we used to get. So I would expect that the processing would be the bigger drag than the memory.
header('HTTP/1.1 420 Enhance Your Calm');