即時通訊我的代碼中的最後一個內容有問題,它說「http://www.w3.org/2001/XMLSchema」不支持!我如何解決這個問題?XML模式 - 「在這種情況下不支持元素」
Screenshoot上問題:http://gyazo.com/ae50e9f14628210ce0a63317e2cf94c0
<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Ansökan">
<xs:complexType>
<xs:sequence>
<xs:element name="hejsanförskolan">
<xs:complexType>
<xs:sequence>
<xs:element name="elev">
<xs:complexType>
<xs:sequence>
<xs:element name="personnummer"
type="datatypPersonnummer"minOccurs="1" />
<xs:element name="förnamn" type="xs:string" minOccurs="1" />
<xs:element name="efternamn" type="xs:string" minOccurs="1" />
<xs:element name="Adress" type="xs:string" minOccurs="1" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element maxOccurs="2" name="vårdnadstagare">
<xs:complexType>
<xs:sequence>
<xs:element name="personnummer"
type="datatypPersonnummer"minOccurs="1" />
<xs:element name="förnamn" type="xs:string" minOccurs="1" />
<xs:element name="efternamn" type="xs:string" minOccurs="1" />
<xs:element name="Adress" type="xs:string" minOccurs="1" />
<xs:element name="Telefonnummer" type="xs:unsignedInt" minOccurs="1" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="syskon" minOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="personnummer" type="datatypPersonnummer" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ömmandeskäl">
<xs:complexType>
<xs:sequence>
<xs:element name="allergi" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:simpleType name="datatypPersonnummer">
<xs:restriction base="xs:string">
<xs:pattern value="[0-9]{10}"/>
</xs:restriction>
</xs:simpleType>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
在XML內我是極端新的如何做到這一點:)? – supbro
@supbro就像在XSD中定義的其他元素一樣。 – Richard
您能否展示您的意思,因爲我不知道:/ – supbro