Go Back   CodingForums.com > :: Client side development > XML

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-11-2012, 08:00 PM   PM User | #1
shawhey
New to the CF scene

 
Join Date: Sep 2012
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
shawhey is an unknown quantity at this point
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?
shawhey is offline   Reply With Quote
Old 09-12-2012, 05:29 PM   PM User | #2
Alex Vincent
Moderator


 
Join Date: May 2002
Location: Hayward, CA
Posts: 1,427
Thanks: 1
Thanked 19 Times in 17 Posts
Alex Vincent is on a distinguished road
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.
__________________
"The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
June 30, 2001
author, Verbosio prototype XML Editor
author, JavaScript Developer's Dictionary
https://alexvincent.us/blog
Alex Vincent is offline   Reply With Quote
Users who have thanked Alex Vincent for this post:
shawhey (09-24-2012)
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:37 PM.


Advertisement
Log in to turn off these ads.