XML creation: Part 1

In this guide, I'll be creating an XML file to store the Playstation games I own, and ultimately make the XML file 'pretty' for Web browsers. I've done this in the past, with my vehicle gas XML document.

In part one, I'll be going over the idea and a layout that I think will work.

The idea

The XML file that I want to create should be able to store all of my Playstation games. Since I own games for multiple generations of the Playstation, I'll want to be able to distinguish between them.

I also want to continue to store the information that I'm storing elsewhere, namely, the date I purchased the game, where I purchased it and for how much, as well as whether I sold the game, and, ultimately, whether I still own it.

The structure

Now that I have an idea of what I'll want to store, I can start digging into how the XML file should be structured.

First, since I'll be storing a number of games, I'll want to wrap them all.

Under that, I'll have each individual game.

For each game, there will be a title, as well as a system, purchase and sell information, including date and price, information about whether I still own it, and any notes.

We then have a basic structure something like the following.

  • games
    • game
      • title
      • system
        • console
        • version
      • purchase
        • date
        • price
        • place
      • sell
        • date
        • price
      • own
      • notes
    • game ...
    • game ...

We'll start with this structure and start adding data, to see if it still makes sense.