Computer Science 853a
Fall 2005 XML Assignment
Part 1: Schema development
- 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.
- 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.
- 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:
- List all the songs with all their data.
- List all the contestants with all their data.
- Give the hometowns of all the contestants.
- Return the song elements for songs containing the word " on ".
- 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:
- Give the names of all singers who sing a song whose title contains
the word "on".
- Show a query which uses the built-in function count.
- Give the names of all singers who have a song by Shania Twain in their
performance.
- Give the names of all singers who have a song composed by themself
in their repertoire.
- 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.