I have this XML for an XSD it is all good except for one error:
Ln 25 Col 50 - s4s-elt-invalid-content.1: The content of '#AnonType_tracks' is invalid. Element 'attribute' is invalid, misplaced, or occurs too often.
Here is my XML code:
<items xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="items.xsd">
<item>
<title>Kind of Blue</title>
<priceus>US: $11.99</priceus>
<priceuk>UK: £8.39</priceuk>
<artist>Miles Davis</artist>
<tracks>
<track length="9:22">So What</track>
<track length="5:37">Blue in Green</track>
<track length="11:33">All Blues</track>
<track length="9:26">Flamenco Sketches</track>
</tracks>
</item>
<item>
<title>Blue Train</title>
<priceus>US: $8.99</priceus>
<priceuk>UK: £6.29</priceuk>
<artist>John Coltrane</artist>
<tracks>
<track length="10:39">Blue Train</track>
<track length="9:06">Moment's Notice</track>
<track length="7:11">Locomotion</track>
</tracks>
</item>
</items>
Here is my XSD:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="title" type="xs:string" />
<xs:element name="priceus" type="xs:string" />
<xs:element name="priceuk" type="xs:string" />
<xs:element name="artist" type="xs:string" />
<xs:attribute name="track" type="xs:string" />
<xs:element name="tracks">
<xs:complexType>
<xs:simpleContent>
<xs:attribute ref="track" use="required" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="item">
<xs:complexType>
<xs:sequence>
<xs:element ref="title" />
<xs:element ref="priceus" />
<xs:element ref="priceuk" />
<xs:element ref="artist" />
<xs:element ref="tracks"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="items">
<xs:complexType>
<xs:sequence>
<xs:element ref="item" minOccurs="1" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>