I'm trying to write a schema that will validate the following XML:
<category type="rifles">
<item>
<name>
AK47
</name>
<description>
The USSR's chief export back in the day, and the guerrilla's best friend. On African flags than any other symbol.
</description>
<cost>
4000
</cost>
<image>
ak47.jpg
</image>
<provenance>
The USSR.
</provenance>
<quantity>
10000
</quantity>
</item>
(Other item elements, surplus heading tags and closing tags ommited.)
And have developed the following schema:
<element name="store">
<complexType>
<sequence>
<element name="category" maxOccurs="unbounded" >
<complexType>
<simpleContent>
<extension base="string">
<attribute name="type" type="string" />
</extension>
</simpleContent>
<sequence>
<element name="item" maxOccurs="unbounded" >
<complexType>
<sequence>
<element name="name" type="string"/>
<element name="description" type="string"/>
<element name="image" type="string"/>
<element name="cost" type="number"/>
<element name="provenence" type="string"/>
<element name="quantity" type="number"/>
</sequence>
</complexType>
</element>
</sequence>
</complexType>
</element>
</sequence>
</complexType>
</element>
Using the validator at http://www.xmlme.com/Validator.aspx?mid=83, I get:
Schema Error: System.Xml.Schema.XmlSchemaException: The content model of a complex type must consist of 'annotation' (if present); followed by zero or one of the following: 'simpleContent', 'complexContent', 'group', 'choice', 'sequence', or 'all'; followed by zero or more 'attribute' or 'attributeGroup'; followed by zero or one 'anyAttribute'.
I know this might sound silly, but can anyone point out my error?