使用 styleVision 得到错误 "复杂类型定义的内容模型 '匿名' "



嗨,我正在使用StyleVision工具。我正在针对 XSD 验证 xml 文件。我运行它说"复杂类型定义'匿名'的内容模型"。但是我的 XML 文件针对 XSD 进行验证。我做错了什么,请纠正我。我的XML和XSD如下

   <?xml version="1.0"?>
    <data>
    <veterinarian>ericsamule</veterinarian>
    <clinic>Clinical Demo    Account- Full Circle Oncology</clinic> 
   <address>asd</address> 
   <phone>55555</phone>
   <date_of_service>2017-01-03</date_of_service>   
   <received_date>2017-01-01</received_date>
   <final_date>2017-01-19</final_date>
   <sample_type>F_dsds</sample_type>
   <accession_id>A-123454</accession_id>
   <lab_id>H-456123</lab_id>
   <panel_notes>cat male</panel_notes>
   <patient>CatCaty</patient>
   <gender>M</gender>
   <dob>1990-01-01</dob>
   <species>Human</species>
  </data>

XSD

    <?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
 <xs:element name="data">
    <xs:complexType>
        <xs:sequence>
            <xs:element name="veterinarian" type="xs:string"/>
            <xs:element name="clinic" type="xs:string"/>
            <xs:element name="address" type="xs:string"/>
            <xs:element name="phone" type="xs:string"/>
            <xs:element name="date_of_service" type="xs:date"/>
            <xs:element name="received_date" type="xs:date"/>
            <xs:element name="final_date" type="xs:date"/>
            <xs:element name="sample_type"  type="xs:string"/>
            <xs:element name="accession_id" type="xs:string"/>
            <xs:element name="lab_id" type="xs:string"/>
            <xs:element name="panel_notes" type="xs:string"/>
            <xs:element name="patient" type="xs:string"/>
            <xs:element name="gender" type="xs:string"/>
            <xs:element name="dob" type="xs:string"/>
            <xs:element name="species" type="xs:string"/>
        </xs:sequence>
    </xs:complexType>
 </xs:element>

您似乎已经切断了错误消息的结尾;您发布的内容只是一个参考,而不是一个完整的陈述。

尽管如此,短语复杂类型定义的内容模型"匿名">是指未命名的类型定义,在您的情况下,它是:

<xs:complexType>
    <xs:sequence>
        <xs:element name="veterinarian" type="xs:string"/>
        <xs:element name="clinic" type="xs:string"/>
        <!-- ... -->
    </xs:sequence>
</xs:complexType>

这与命名类型定义形成对比,例如

<xs:complexType name="DataType">
    <xs:sequence>
        <xs:element name="veterinarian" type="xs:string"/>
        <xs:element name="clinic" type="xs:string"/>
        <!-- ... -->
    </xs:sequence>
</xs:complexType>

可以像这样引用:

<xs:element name="data" type="DataType"/>

希望对匿名含义的解释可以帮助您理解错误消息的其余部分。 如果没有,请使用完整的错误消息和任何补充文件更新您的问题,了解StyleVision的人需要进一步帮助您。

最新更新