rc-resolve.4.2: Error resolving component 'usertype'. It was detected that 'usertype' is in
namespace 'http://www.w3.org/2001/XMLSchema', but components from this namespace are not
namespace 'http://www.w3.org/2001/XMLSchema', but components from this namespace are not
referenceable from schema document
以上错误来源一以下的关系型xml schame
<?xml version="1.0" encoding="UTF-8"?>
<!-- 本空间用的是xs -->
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/user3"
xmlns:tns="http://www.example.org/user3" elementFormDefault="qualified">
<element name="users" type="tns:userstype"></element>
<element name="user" type="usertype"></element>
<element name="name"></element>
<element name="password"></element>
<element name="age"></element>
<complexType name="userstype">
<sequence>
<element ref="user"></element>
</sequence>
</complexType>
<complexType name="usertype">
<sequence>
<element ref="name"></element>
<element ref="password"></element>
<element ref="age"></element>
</sequence>
<attribute name="id" use="required" > </attribute>
<attribute name="note" use="optional" > </attribute>
</complexType>
</schema>
为什么呢, 原来是原本的 element 来源于默认的命名空间
http://www.w3.org/2001/XMLSchema
而对于usertype ,password,age, name 是自定义的命名空间
xmlns:tns="http://www.example.org/user3"
所以必须定义自己命名空间
在ref、、还有就是type中要改
tns:password 之类的
以下就是正确的