Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: Cross-referencing XML documents
09-11-2012, 08:00 PM #1
- Join Date
- Sep 2012
- Thanked 0 Times in 0 Posts
Cross-referencing XML documents
Hi, so I'm rather new at XML. I've coded in php and mysql before, but now I'm trying to learn AJAX, more specifically using XML to store and change data based on the enduser's selections from option and checkbox lists. Anyways, the problem I've come across is before any of that starts.
To give you specifics, I'm creating a webpage for my fantasy NHL league to select players from their previous teams that they would like to keep on their rosters. There are some restrictions on which players they can keep, so I need to be able to reference between a player's information (things like age, what round he was selected, and previous season stats) and the league member's roster. I feel right now as though there are two ways I can do this.
My first option would be to create an XML document of NHL players with all their information. This would require parsing through the entire player database to call on each league member's roster and keeper options.
My second option is a bit fuzzy to me right now, but it would basically be creating a document with each league member's roster, then create seperate documents full of all players who are allowed to be kept under each restriction. Then cross-reference the document containing member's roster with the one containing players they're allowed to keep and display only the players found in both documents (simply put, display players on the logged-in member's roster who appears on the list of keepers). Is that possible?
09-12-2012, 05:29 PM #2
- Join Date
- May 2002
- Hayward, CA
- Thanked 24 Times in 22 Posts
It's absolutely possible. You just have to be willing to incur the extra overhead of looking up the reference URL in one document, so you can find out what secondary document(s) you need to make another XMLHttpRequest for.
Where I work, we used to have a 2MB master XML file. I ran an experiment in PHP where I broke that file up into many smaller chunks. I saw performance improvements of 20x or better, trying to get the data we needed. So yes, sometimes breaking up the data set into smaller files is a good thing.
Users who have thanked Alex Vincent for this post: