Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Sep 2012
    Posts
    2
    Thanks
    1
    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?

  • #2
    Moderator
    Join Date
    May 2002
    Location
    Hayward, CA
    Posts
    1,453
    Thanks
    1
    Thanked 21 Times in 19 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.
    "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

  • Users who have thanked Alex Vincent for this post:

    shawhey (09-24-2012)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •