Ошибка при проверке схемы XML

Я хочу создать простую схему для пустого элемента

 <product orderid="4"/>

Я создал свой XSD следующим образом:

<?xml version="1.0" encoding="UTF-8"?>


<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://xml.netbeans.org/schema/first"
xmlns:tns="http://xml.netbeans.org/schema/first"
elementFormDefault="qualified">

<xsd:element name="product" type="prodtype"/>
<xsd:complexType name="prodtype">
        <xsd:attribute name="prodid" type="xsd:integer"/>
</xsd:complexType>

</xsd:schema>

Я получаю следующую ошибку при проверке XML на соответствие XSD:

 Error resolving component 'prodtype'. It was detected that 'prodtype' has no namespace, but components with no target namespace are not referenceable from schema document 'file:/D:/Teacher%20assistant%202011/First%20term/web%20services/test%20programs/BpelModule1/src/product.xsd'. If 'prodtype' is intended to have a namespace, perhaps a prefix needs to be provided. If it is intended that 'prodtype' has no namespace, then an 'import' without a "namespace" attribute should be added to 'file:/D:/Teacher%20assistant%202011/First%20term/web%20services/test%20programs/BpelModule1/src/product.xsd'.
7
задан monojohnny 4 March 2015 в 10:33
поделиться