Я новичок в xsd и xml. Я написала схему по заданию, но при попытке проверить ее через онлайн-переводчики, пишут: The 'http://www.w3.org/2001/XMLSchema:complexType' element is not supported in this context.
Прошу помощи в указании где ошибка и желательно как ее исправить. Так же буду признательна ответу на вопрос, как сделать для xsd схемы xml, которую будет проверять xsd.
Да, и еще вопрос, как проверить что будет выдаваться при заполнении xml специальными значениями, и запуске xsd на проверку xml? Возможно ли это?
Вот мой xsd:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="CupboardRequest">
<xsd:annotation>
<xsd:documentation>Запрос данных о шкафчике</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Employee" type="xsd:string" minOccurs="1" maxOccurs="1"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="CupboardResponse">
<xsd:annotation>
<xsd:documentation>Ответ о содержимом</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Employee" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="Status" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="Cupboard" type="xsd:string" minOccurs="0" maxOccurs="1">
<xsd:complexType>
<xsd:sequence>
<!-- Шкафчик -->
<xsd:element name="CupboardMini" type="xsd:string" minOccurs="1" maxOccurs="3"/>
<xsd:element name="CupboardMaxi" type="xsd:string" minOccurs="1" maxOccurs="1"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="CupboardMini">
<xsd:annotation>
<xsd:documentation> маленький ящик </xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<!-- маленькие предметы -->
<xsd:element name="MiniItem" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Items" type="xsd:string" minOccurs="1" maxOccurs="10"/>
</xsd:sequence>
</xsd:complexType>
<!-- большой предмет -->
<xsd:element name="MaxiItem" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Items" type="xsd:string" minOccurs="1" maxOccurs="10"/>
</xsd:sequence>
</xsd:complexType>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CupboardMaxi">
<xsd:annotation>
<xsd:documentation> большой ящик </xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<!-- маленькие предметы -->
<xsd:element name="MiniItem" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Items" type="xsd:string" minOccurs="0" maxOccurs="10"/>
</xsd:sequence>
</xsd:complexType>
<!-- большие предметы -->
<xsd:element name="MaxiItem" type="xsd:string" minOccurs="0" maxOccurs="3"/>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Items" type="xsd:string" minOccurs="1" maxOccurs="1"/>
</xsd:sequence>
</xsd:complexType>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="Items">
<xsd:annotation>
<xsd:documentation> предмет </xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<!-- id причины дефолта/снятия дефолта -->
<xsd:element name="Simple" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<!-- windows login голосующего -->
<xsd:element name="Book" type="bookType" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="bookType">
<xsd:sequence>
<xsd:element name="title" type="xsd:string"/>
<xsd:element name="author" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<!-- Описания типов -->
<xsd:simpleType name="EmployeeName">
<xsd:restriction base="xsd:string">
<xsd:minLength value="3"/>
<xsd:pattern value="^[A-Z][a-zA-Z]{3,20}$"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="StatusType">
<xsd:restriction base="xsd:string">
<xsd:minLength value="4"/>
<xsd:maxLength value="6" />
<xsd:pattern value="^[A-Z][a-zA-Z]{4,6}$"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>