Putting Together XML (Introductory): You Do It

This is the second part of "Putting Together XML".

In the first part, we had an idea for an XML file, and a number of lines of XML code, all scrambled up. In this section, we'll give you the idea and you can create the code yourself.

 

Here's the Idea:

You're creating a resource with information about city parks. You'll need to create XML information that includes:

  • The XML prolog
  • The fact that this is about parks
  • Information about each individual park, including:
    • Name of the park
    • Size
    • Address or location
    • Hours of operation
    • Facilities available (this will be a simple list)

As you create an example database, you can use these two examples, and/or any other park examples you like:

  • Freeway Park, between 6th Ave., 9th Ave., Spring St., and Union St. It is 5.2 acres in size, open 6 AM to 11:30 PM, with benches, restrooms, trails, and WiFi
  • Westlake Park, 401 Pine St. is 0.1 acre in size. It is open 6 AM to 11:30 PM, and has foutain, benches, public art, and WiFi.

Open a text editor and create an XML file to represent this data, or data like it.

Done? There is more than one way to do this, but this link will take you to one correct example