0
架构限制了我的xampleXML与复杂类型
<xsd:element name="Subject" minOccurs="1" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>Name of the subject. Values are: Vaje, Kolokvij, Predavanje, Izpit</xsd:documentation>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="Vaje"/>
<xsd:enumeration value="Kolokvik"/>
<xsd:enumeration value="Predavanje"/>
<xsd:enumeration value="Izpit"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="Professor" minOccurs="1" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>Name of the professors</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:attribute name="prof" type="Professors"/>
</xsd:complexType>
</xsd:element>
,我也有教授作为限制,你不能插入别的
<xsd:element name="Professors">
<xsd:complexType>
<xsd:attribute name="id"/>
<xsd:attribute name="name"/>
<xsd:attribute name="surname"/>
<xsd:attribute name="code"/>
<xsd:attribute name="email"/>
</xsd:complexType>
</xsd:element>
,但我总是在这里<xsd:attribute name="prof" type="Professors"/>
这个错误
'Professors' must refer to an existing simple or complex type.
我想要什么? XML是这样的:
<Professors id="1" name="sss" surname="sss" code="15426" email="[email protected]"/>
<Professors id="2" name="fff" surname="ff" code="15446" email="[email protected]"/>
,然后在以后的我笏使用的是1号从ID
<Subject>vaje</Subject>
<Professor>1</Professor>
如何创建模式?
谢谢你的帮助 – senzacionale