I am new in learning XML. I have to create a XSD for my XML file.
Below is my XSD file. But I got an error like this:
s4s-elt-must-match.1: The content of 'Album' must match (annotation?, (simpleType | complexType)?, (unique | key | keyref)*)). A problem was found starting at: element. music.xsd
I cannot figured it out. Could anyone help me? Thanks a lot!
my xml file
xsd file
Below is my XSD file. But I got an error like this:
s4s-elt-must-match.1: The content of 'Album' must match (annotation?, (simpleType | complexType)?, (unique | key | keyref)*)). A problem was found starting at: element. music.xsd
I cannot figured it out. Could anyone help me? Thanks a lot!
my xml file
Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Music xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- First ALbum -->
<Album>
<Title>Take Care</Title>
<AlbumArtist>Drake</AlbumArtist>
<Genre>Pop</Genre>
<Year>2012</Year>
<Publisher>Cash Money Records Inc</Publisher>
<Price concurrency="AUD">12.0</Price>
<Song>
<Title>Over My Dead Body</Title>
<Artist>Drake</Artist>
<Genre>Pop</Genre>
<Album>Take Care</Album>
<Year>2012</Year>
<Price concurrency="AUD">2.0</Price>
</Song>
<Song>
<Title>Shot For Me</Title>
<Artist>Drake</Artist>
<Genre>Pop</Genre>
<Album>Take Care</Album>
<Year>2012</Year>
<Price concurrency="AUD">1.0</Price>
</Song>
<Song>
<Title>Headlines</Title>
<Artist>Drake</Artist>
<Genre>HipHop</Genre>
<Album>Take Care</Album>
<Year>2012</Year>
<Price concurrency="AUD">2.5</Price>
</Song>
<Song>
<Title>We'll Be Fine</Title>
<Artist>Drake</Artist>
<Genre>Pop</Genre>
<Album>Take Care</Album>
<Year>2012</Year>
<Price concurrency="AUD">3.0</Price>
</Song>
<Song>
<Title>Lord Knows</Title>
<Artist>Drake</Artist>
<Genre>Pop</Genre>
<Album>Take Care</Album>
<Year>2012</Year>
<Price concurrency="AUD">2.0</Price>
</Song>
<Song>
<Title>Do It Wrong</Title>
<Artist>Drake</Artist>
<Genre>Hip-Hop</Genre>
<Album>Take Care</Album>
<Year>2012</Year>
<Price concurrency="AUD">2.5</Price>
</Song>
</Album>
<!-- Second ALbum -->
<Album>
<Title>Lioness: Hidden Treasures</Title>
<AlbumArtist>AmyWinehouse</AlbumArtist>
<Genre>Soul</Genre>
<Year>2011</Year>
<Publisher>Universal Island Records</Publisher>
<Price concurrency="AUD">14.0</Price>
<Song>
<Title>Tears Cry</Title>
<Artist>AmyWinehouse</Artist>
<Genre>Soul</Genre>
<Album>Lioness: Hidden Treasures</Album>
<Year>2011</Year>
<Price concurrency="AUD">3.0</Price>
</Song>
<Song>
<Title>Like Smoke</Title>
<Artist>AmyWinehouse</Artist>
<Genre>Soul</Genre>
<Album>Lioness: Hidden Treasures</Album>
<Year>2011</Year>
<Price concurrency="AUD">2.0</Price>
</Song>
<Song>
<Title>Will You Still Love Me Tomorrow?</Title>
<Artist>Amy Winehouse</Artist>
<Genre>Soul</Genre>
<Album>Lioness: Hidden Treasures</Album>
<Year>2011</Year>
<Price concurrency="AUD">2.5</Price>
</Song>
<Song>
<Title>Wake Up Alone</Title>
<Artist>Amy Winehouse</Artist>
<Genre>Soul</Genre>
<Album>Lioness: Hidden Treasures</Album>
<Year>2011</Year>
<Price concurrency="AUD">2.0</Price>
</Song>
<Song>
<Title>Body And Soul</Title>
<Artist>Amy Winehouse</Artist>
<Genre>Soul</Genre>
<Album>Lioness: Hidden Treasures</Album>
<Year>2011</Year>
<Price concurrency="AUD">12.0</Price>
</Song>
<Song>
<Title>A Song For You</Title>
<Artist>Amy Winehouse</Artist>
<Genre>Soul</Genre>
<Album>Lioness: Hidden Treasures</Album>
<Year>2011</Year>
<Price concurrency="AUD">1.5</Price>
</Song>
<Song>
<Title>Half TIme</Title>
<Artist>Amy Winehouse</Artist>
<Genre>Soul</Genre>
<Album>Lioness: Hidden Treasures</Album>
<Year>2011</Year>
<Price concurrency="AUD">1.5</Price>
</Song>
</Album>
<!-- Third ALbum -->
<Album>
<Title>Classic Mountain Songs from Smithsonian Folkways</Title>
<AlbumArtist/>
<Genre>Country</Genre>
<Year>2008</Year>
<Publisher/>
<Price concurrency="AUD">8.0</Price>
<Song>
<Title>Super Baby</Title>
<Artist>Dock Boggs</Artist>
<Genre>Country</Genre>
<Album>Classic Mountain Songs from Smithsonian Folkways</Album>
<Year>2008</Year>
<Price concurrency="AUD">1.0</Price>
</Song>
<Song>
<Title>John Hery</Title>
<Artist>Lesley Riddle</Artist>
<Genre>Country</Genre>
<Album>Classic Mountain Songs from Smithsonian Folkways</Album>
<Year>2008</Year>
<Price concurrency="AUD">1.5</Price>
</Song>
<Song>
<Title>Coal Creek March</Title>
<Artist>Pete Steele</Artist>
<Genre>Country</Genre>
<Album>Classic Mountain Songs from Smithsonian Folkways</Album>
<Year>2008</Year>
<Price concurrency="AUD">0.5</Price>
</Song>
<Song>
<Title>Railroad Blues</Title>
<Artist>Sam McGee</Artist>
<Genre>Country</Genre>
<Album>Classic Mountain Songs from Smithsonian Folkways</Album>
<Year>2008</Year>
<Price concurrency="AUD">0.5</Price>
</Song>
<Song>
<Title>Sixteen Tons</Title>
<Artist>George Davis</Artist>
<Genre>Country</Genre>
<Album>Classic Mountain Songs from Smithsonian Folkways</Album>
<Year>2008</Year>
<Price concurrency="AUD">1.5</Price>
</Song>
<Song>
<Title>I Am A Poor Pilgrim Of Sorrow</Title>
<Artist>Old Regular Baptists</Artist>
<Genre>Country</Genre>
<Album>Classic Mountain Songs from Smithsonian Folkways</Album>
<Year>2008</Year>
<Price concurrency="AUD">0.5</Price>
</Song>
</Album>
<!-- Fourth ALbum -->
<Album>
<Title>Talk That Talk</Title>
<AlbumArtist>Rihanna</AlbumArtist>
<Genre>Pop</Genre>
<Year>2011</Year>
<Publisher>Def Jam Records</Publisher>
<Price concurrency="AUD">10.0</Price>
<Song>
<Title>We Found Love</Title>
<Artist>Rihanna</Artist>
<Genre>HipHop</Genre>
<Album>Talk That Talk</Album>
<Year>2011</Year>
<Price concurrency="AUD">2.0</Price>
</Song>
<Song>
<Title>Farewell</Title>
<Artist>Rihanna</Artist>
<Genre>HipHop</Genre>
<Album>Talk That Talk</Album>
<Year>2011</Year>
<Price concurrency="AUD">1.0</Price>
</Song>
<Song>
<Title>Birthday Cake</Title>
<Artist>Rihanna</Artist>
<Genre>HipHop</Genre>
<Album>Talk That Talk</Album>
<Year>2011</Year>
<Price concurrency="AUD">1.5</Price>
</Song>
<Song>
<Title>We All Want Love</Title>
<Artist>Rihanna</Artist>
<Genre>Pop</Genre>
<Album>Talk That Talk</Album>
<Year>2011</Year>
<Price concurrency="AUD">1.0</Price>
</Song>
<Song>
<Title>Red Lipstick</Title>
<Artist>Rihanna</Artist>
<Genre>HipHop</Genre>
<Album>Talk That Talk</Album>
<Year>2011</Year>
<Price concurrency="AUD">2.0</Price>
</Song>
<Song>
<Title>Fool In Love</Title>
<Artist>Rihanna</Artist>
<Genre>Pop</Genre>
<Album>Talk That Talk</Album>
<Year>2011</Year>
<Price concurrency="AUD">1.5</Price>
</Song>
<Song>
<Title>Where Have You Been</Title>
<Artist>Rihanna</Artist>
<Genre>Pop</Genre>
<Album>Talk That Talk</Album>
<Year>2011</Year>
<Price concurrency="AUD">3.0</Price>
</Song>
<Song>
<Title>Drunk On Love</Title>
<Artist>Rihanna</Artist>
<Genre>HipHop</Genre>
<Album>Talk That Talk</Album>
<Year>2011</Year>
<Price concurrency="AUD">2.0</Price>
</Song>
</Album>
<!-- Fifth ALbum -->
<Album>
<Title>World Connections</Title>
<AlbumArtist>Linkin Park</AlbumArtist>
<Genre>Electronic</Genre>
<Year>2011</Year>
<Publisher>Record Union</Publisher>
<Price concurrency="AUD">4.0</Price>
<Song>
<Title>Put Your Hands Up</Title>
<Artist>Linkin Park</Artist>
<Genre>ELectronic</Genre>
<Album>World Connections</Album>
<Year>2011</Year>
<Price concurrency="AUD">2.0</Price>
</Song>
<Song>
<Title>New Divide</Title>
<Artist>Linkin Park</Artist>
<Genre>ELectronic</Genre>
<Album>World Connections</Album>
<Year>2011</Year>
<Price concurrency="AUD">1.0</Price>
</Song>
<Song>
<Title>Got To Know</Title>
<Artist>Linkin Park</Artist>
<Genre>ELectronic</Genre>
<Album>World Connections</Album>
<Year>2011</Year>
<Price concurrency="AUD">1.0</Price>
</Song>
<Song>
<Title>Getting Over You</Title>
<Artist>Linkin Park</Artist>
<Genre>ELectronic</Genre>
<Album>World Connections</Album>
<Year>2011</Year>
<Price concurrency="AUD">1.0</Price>
</Song>
</Album>
<!-- Sixth ALbum -->
<Album>
<Title>Jason Mraz Live + Acoustic 2001</Title>
<AlbumArtist>James Blunt</AlbumArtist>
<Genre>Pop</Genre>
<Year>2008</Year>
<Publisher>Jason Mraz/TuneCore</Publisher>
<Price concurrency="AUD">7.0</Price>
<Song>
<Title>Running</Title>
<Artist>Jason Mraz</Artist>
<Genre>Pop</Genre>
<Album>Jason Mraz Live + Acoustic 2001</Album>
<Year>2008</Year>
<Price concurrency="AUD">1.0</Price>
</Song>
<Song>
<Title>You And I Both</Title>
<Artist>Jason Mraz</Artist>
<Genre>Pop</Genre>
<Album>Jason Mraz Live + Acoustic 2001</Album>
<Year>2008</Year>
<Price concurrency="AUD">1.5</Price>
</Song>
<Song>
<Title>Bright Eyes</Title>
<Artist>Jason Mraz</Artist>
<Genre>Pop</Genre>
<Album>Jason Mraz Live + Acoustic 2001</Album>
<Year>2008</Year>
<Price concurrency="AUD">2.0</Price>
</Song>
<Song>
<Title>Halfway Home</Title>
<Artist>Jason Mraz</Artist>
<Genre>Pop</Genre>
<Album>Jason Mraz Live + Acoustic 2001</Album>
<Year>2008</Year>
<Price concurrency="AUD">0.5</Price>
</Song>
<Song>
<Title>Unfold</Title>
<Artist>Jason Mraz</Artist>
<Genre>Pop</Genre>
<Album>Jason Mraz Live + Acoustic 2001</Album>
<Year>2008</Year>
<Price concurrency="AUD">1.0</Price>
</Song>
<Song>
<Title>1000 Things</Title>
<Artist>Jason Mraz</Artist>
<Genre>Pop</Genre>
<Album>Jason Mraz Live + Acoustic 2001</Album>
<Year>2008</Year>
<Price concurrency="AUD">1.5</Price>
</Song>
<Song>
<Title>After An Afternoon</Title>
<Artist>Jason Mraz</Artist>
<Genre>Pop</Genre>
<Album>Jason Mraz Live + Acoustic 2001</Album>
<Year>2008</Year>
<Price concurrency="AUD">1.0</Price>
</Song>
<Song>
<Title>Conversation With Myself</Title>
<Artist>Jason Mraz</Artist>
<Genre>Pop</Genre>
<Album>Jason Mraz Live + Acoustic 2001</Album>
<Year>2008</Year>
<Price concurrency="AUD">0.5</Price>
</Song>
<Song>
<Title>Zero Percent</Title>
<Artist>Jason Mraz</Artist>
<Genre>Pop</Genre>
<Album>Jason Mraz Live + Acoustic 2001</Album>
<Year>2008</Year>
<Price concurrency="AUD">1.0</Price>
</Song>
<Song>
<Title>Common Pleasure</Title>
<Artist>Jason Mraz</Artist>
<Genre>Pop</Genre>
<Album>Jason Mraz Live + Acoustic 2001</Album>
<Year>2008</Year>
<Price concurrency="AUD">2.0</Price>
</Song>
<Song>
<Title>Hey Love</Title>
<Artist>Jason Mraz</Artist>
<Genre>Pop</Genre>
<Album>Jason Mraz Live + Acoustic 2001</Album>
<Year>2008</Year>
<Price concurrency="AUD">1.0</Price>
</Song>
</Album>
<!-- Seventh ALbum -->
<Album>
<Title>Boys and Girls Soundtrack</Title>
<AlbumArtist>Ronan Keating</AlbumArtist>
<Genre>Pop</Genre>
<Year>2000</Year>
<Publisher>Ark 21 Records / IODA</Publisher>
<Price concurrency="AUD">6.0</Price>
<Song>
<Title>Happiness</Title>
<Artist>Ronan Keating</Artist>
<Genre>Pop</Genre>
<Album>Boys and Girls Soundtrack</Album>
<Year>2000</Year>
<Price concurrency="AUD">0.5</Price>
</Song>
<Song>
<Title>I Know A Girl</Title>
<Artist>Ronan Keating</Artist>
<Genre>Pop</Genre>
<Album>Boys and Girls Soundtrack</Album>
<Year>2000</Year>
<Price concurrency="AUD">0.5</Price>
</Song>
<Song>
<Title>When You Arrive</Title>
<Artist>Ronan Keating</Artist>
<Genre>Pop</Genre>
<Album>Boys and Girls Soundtrack</Album>
<Year>2000</Year>
<Price concurrency="AUD">0.5</Price>
</Song>
<Song>
<Title>Think Of Me</Title>
<Artist>Ronan Keating</Artist>
<Genre>Pop</Genre>
<Album>Boys and Girls Soundtrack</Album>
<Year>2000</Year>
<Price concurrency="AUD">0.5</Price>
</Song>
<Song>
<Title>Gorgeous</Title>
<Artist>Ronan Keating</Artist>
<Genre>Pop</Genre>
<Album>Boys and Girls Soundtrack</Album>
<Year>2000</Year>
<Price concurrency="AUD">0.5</Price>
</Song>
<Song>
<Title>Quitter</Title>
<Artist>Ronan Keating</Artist>
<Genre>Pop</Genre>
<Album>Boys and Girls Soundtrack</Album>
<Year>2000</Year>
<Price concurrency="AUD">0.5</Price>
</Song>
<Song>
<Title>Now Or Never</Title>
<Artist>Ronan Keating</Artist>
<Genre>Pop</Genre>
<Album>Boys and Girls Soundtrack</Album>
<Year>2000</Year>
<Price concurrency="AUD">0.5</Price>
</Song>
<Song>
<Title>World Of A King</Title>
<Artist>Ronan Keating</Artist>
<Genre>Pop</Genre>
<Album>Boys and Girls Soundtrack</Album>
<Year>2000</Year>
<Price concurrency="AUD">0.5</Price>
</Song>
<Song>
<Title>Get You Off My Mind</Title>
<Artist>Ronan Keating</Artist>
<Genre>Pop</Genre>
<Album>Boys and Girls Soundtrack</Album>
<Year>2000</Year>
<Price concurrency="AUD">0.5</Price>
</Song>
</Album>
</Music>
Code:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Music">
<xs:complexType>
<xs:sequence>
<xs:element name="Album" type="xs:string" minOccurs="1" maxOccurs="unbounded">
<xs:element name="Title" type="xs:string" />
<xs:element name="AlbumArtist" type="xs:string" minOccurs="0" maxOccurs="1" />
<xs:element name="Genre" type="xs:string" />
<xs:element name="Year" type="xs:integer" />
<xs:element name="Publisher" type="xs:string" />
<xs:complexType>
<xs:sequence>
<xs:element name="Price" type="xs:float">
<xs:attribute name="currency" fixed="AUD" use="required" />
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType>
<xs:sequence>
<xs:element name="Song" type="xs:string" maxOccurs="unbounded">
<xs:element name="Title" type="xs:string" />
<xs:element name="Artist" type="xs:string" />
<xs:element name="Genre" type="xs:string" />
<xs:element name="Album" type="xs:string" />
<xs:element name="Year" type="xs:integer" />
<xs:complexType>
<xs:sequence>
<xs:element name="Price" type="xs:float">
<xs:attribute name="currency" fixed="AUD" use="required" />
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Comment