我用vs2005做一个xsd文件,文件如下。
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="MechaHandConfig" elementFormDefault="qualified" xmlns="http://tempuri.org/MechaHandConfig.xsd" xmlns:mstns="http://tempuri.org/MechaHandConfig.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="ManipulatorConfig" type="ManipulatorType">
    <xs:annotation>
      <xs:documentation>易迅科技机械手配置文件定义标准</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="ManipulatorType">
    <xs:sequence>
      <xs:element name="BaseJoint" type="JointType">
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="JointType">
    <xs:sequence>
      <xs:element name="ID" type="xs:integer">
      </xs:element>
    </xs:sequence>
  </xs:complexType>
</xs:schema>它总在element下面显示一条蓝色的波浪线,提示“未声明:http://tempuri.org/ManipulatorConfig.xsd:ManipulatorType类型”,这是为什么?

解决方案 »

  1.   

    xsd的xml文件都是自动生成的,
    很难修改,即使修改了,重新编译又回到原来的!!
    可能那里设置不对!!!
      

  2.   

    不是用数据集,我想自己做一个xsd,然后定义的xml都遵循这个xsd。
      

  3.   

    This schema dosen't appear to be valid by itself(as a part of another sechema, it might still be OK)
    No type with name "manipulatorType" has been difined in this or in included/imported schemas!去掉 xmlns="http://tempuri.org/MechaHandConfig.xsd"<?xml version="1.0" encoding="utf-8"?> 
    <xs:schema id="MechaHandConfig" elementFormDefault="qualified" xmlns="http://tempuri.org/MechaHandConfig.xsd" xmlns:mstns="http://tempuri.org/MechaHandConfig.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema"> 
      <xs:element name="ManipulatorConfig" type="ManipulatorType">