<?xml version="1.0" encoding="utf-8"?>
<!--
remove the comment to expose the DOCTYPE below when you 
are ready.

<!DOCTYPE music-library SYSTEM "musiclibrary.dtd">

-->
<!--

Your goal in this HW is to develop an XML schema that can represent this music library.

This is due by Tuesday Dec 9 at the start of class.

-->
<music-library xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="musiclibraryschema.xsd">
  <!-- 
      A music library is zero or more releases 
	  followed by zero or more performers
   -->
  <!-- 
      1) the genre atrribute of a release is optional  
      2) a release has an artist and at least one song
	  3) a song's name attribute is required 
	     but its length attribute is optional.
   -->
  <!-- 
      A genre attribute is optional and can be one of:
          jazz , soul , altrock , electronic , rb , baroquePop , 
	      indieRock , techno , soundtrack , country , reggae , 
	   	  altcountry , classical , metal , rock , hiphop , rap , 
		  newage , alternative , pop , elevator , folk
	  
	  The id attribute is unique and required for each release
	  
	  The artist attribute refers to the artist of this release and is required
	  
	  The title is required
	  
	  A release has one or more songs. The song length is optional but the song name is required.
	  The song length, if it exists, should be one or more digits followed by a mandatory semicolon, 
	  followed by two digits.
   -->
  <release id="r4" title="Giant Steps" genre="jazz" artist="jc">
    <song length="4:02" name="Giant Steps" />
    <song length="8:15" name="Naima" />
  </release>
  <release id="r3" title="The Band - Greatest Hits" genre="rock" artist="tb">
    <song length="4:31" name="Up On Cripple Creek" />
    <song length="3:32" name="The Night They Drove Old Dixie Down" />
    <song length="3:41" name="Stage Fright" />
  </release>
  <release id="r2" title="Drive In Movie" genre="altcountry" artist="fe">
    <song length="3:43" name="White Rose"/>
    <song length="4:16" name="I Like Trains"/>
  </release>
  <release id="r1" title="Balin" genre="altcountry" artist="fe">
    <song length="4:14" name="The Rocket"/>
    <song length="3:45" name="Small Motors"/>
    <song name="Tin Pot Nelly" />
  </release>
  <!-- 
       performers 
   
       A performer is an individual artist or a band
       
	   A performer also has an optional note field.
	   
	   A performer has a unique id attribute
   -->
  <performer id="jc">
    <artist>
      <first>John</first>
      <last>Coltrane</last>
    </artist>
    <note>Jazz Saxophonist</note>
    <rel r="r4" />
  </performer>
  <performer id="tb">
    <band name="The Band">
      <!-- 
		   a band has one or more artists 
		   
		   An artist is a first name, optional middle name, followed by a last name.
		   
		   An artist can have zero or more performers they listen to.
		-->
      <members>
        <artist>
          <first>Robbie</first>
          <last>Robertson</last>
          <listensto performer="jc" />
          <listensto performer="fe" />
        </artist>
        <artist>
          <first>Richard</first>
          <last>Manuel</last>
        </artist>
      </members>
    </band>
    <rel r="r2" />
    <rel r="r1" />
  </performer>
  <performer id="fe">
    <band name="Fred Eaglesmith and the Flathead Noodlers">
      <members>
        <artist>
          <first>Fred</first>
          <last>Eaglesmith</last>
        </artist>
        <artist>
          <first>Willie</first>
          <middle>P.</middle>
          <last>Bennett</last>
        </artist>
        <artist>
          <first>Kori</first>
          <middle>P.</middle>
          <last>Heppner</last>
        </artist>
      </members>
    </band>
    <rel r="r3" />
  </performer>
</music-library>
