Computer Science 853a 

Fall 2005 XML Assignment

Part 1:  Schema development

  1. Using the "Western Idol" data, found in contestants.xml and songs.xml, write an XML Schema so that there are no attributes, i.e. so that all the data is in subelements.
  2. Convert the existing data to conform to your schema.  There is a galax-parse command in galax, or you can use another tool like Altova spy.
  3. Hand in a copy of your schema and the two document files.

Part 2: XPath

     Show the XPath queries and the answers for the following:
  1. List all the songs with all their data.
  2. List all the contestants with all their data.
  3. Give the hometowns of all the contestants.
  4. Return the song elements for songs containing the word " on ".
  5. Give the song titles of songs in Paul McCartney's repertoire.

Part 3: XQuery  

    Using FLWR queries, show XQuery queries and their answers for the following:
  1. Give the names of all singers who sing a song whose title contains the word "on".
  2. Show a query which uses the built-in function count.
  3. Give the names of all singers who have a song by Shania Twain in their performance.
  4. Give the names of all singers who have a song composed by themself in their repertoire.
  5. Create a valid XML document which has songs as children of the root, with each song having its song name, composer name, and then a list of the singer names where the singer has this song in their repertoire.