xsd代码错误

lzd23722086 2017-05-22 03:43:15
代码如下:
<?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}'.
...全文
348 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
hookee 2017-05-23
  • 打赏
  • 举报
回复
定义里没有name属性? <!ATTLIST %schema; targetNamespace %URIref; #IMPLIED version CDATA #IMPLIED %nds; %URIref; #FIXED 'http://www.w3.org/2001/XMLSchema' xmlns CDATA #IMPLIED finalDefault %complexDerivationSet; '' blockDefault %blockSet; '' id ID #IMPLIED elementFormDefault %formValues; 'unqualified' attributeFormDefault %formValues; 'unqualified' defaultAttributes CDATA #IMPLIED xpathDefaultNamespace CDATA '##local' xml:lang CDATA #IMPLIED %schemaAttrs;>

8,906

社区成员

发帖
与我相关
我的任务
社区描述
XML/XSL相关问题讨论专区
社区管理员
  • XML/XSL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧