xsd代码错误
代码如下:
<?xml version="1.0" encoding="GB2312"?>
<xsd:schema name="slschema" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<element name="phonenumber" type="phoneType"/>
<xsd:simpleType name="phoneType">
<xsd:restriction base="xsd:string">
<xsd:Length value="11"/>
<xsd:pattern value="[0-9]*"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>
错误如下:
File E:\XMLSpy2013\4\Untitled1.xsd is not valid.
Attribute 'name' is not allowed in element <xsd:schema>
Hint: Attribute is neither explicitly allowed nor covered by attribute wildcard {any except http://www.w3.org/2001/XMLSchema}.
Error location: xsd:schema / @name
Details
cvc-wildcard-namespace: Wildcard {any except http://www.w3.org/2001/XMLSchema} does not allow the namespace name of 'name'.
cvc-elt.5.2.1: The element <xsd:schema> is not valid with respect to the actual type definition '{anonymous}'.