Whats wrong with this XSD?
Hello!Our customer has provide us with this xsd:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="Document">
<xs:complexType>
<xs:attribute name="Id" type="xs:string" use="required"/>
<xs:attribute name="Name" use="required">
<xs:simpleType>
<xs:restriction base="xs:string"/>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="Category" use="required">
<xs:simpleType>
<xs:restriction base="xs:string"/>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="DocumentList">
<xs:complexType>
<xs:sequence>
<xs:element ref="Document" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Folder">
<xs:complexType>
<xs:sequence>
<xs:element ref="DocumentList"/>
</xs:sequence>
<xs:attribute name="Id" type="xs:string" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="[0-9]{4}-[0-9]{4}"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>
But during my validation in my Java code with this xsl and in XML Spy I got the message that this XSL is not valid, the message looks like this in XML Spy:
This schema doesn'tmappear to be valid by itself (as part of another schema, it might still be OK):
Schema error - undefind schema component 'xs:simpleType' encountered - only one type or simpleType may be used
It also points/marks the rows:
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="[0-9]{4}-[0-9]{4}"/>
</xs:restriction>
</xs:simpleType>
So I guess ther must be a problem here.
Do you see the problem?
Best regards
Fredrik