1
您好我正在使用StyleVision工具。我正在根據XSD驗證xml文件。當我運行它說「複雜類型定義的內容模型'匿名'」。但是我的XML文件針對XSD進行了驗證。我做錯什麼好心糾正我。我的XML和XSD下面使用styleVision獲取錯誤「複雜類型定義的內容模型」匿名'「
<?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>
這就是完整的錯誤。 「複雜類型定義'{anonymous}'的內容是'空'」 – anila
不,這不是完整的錯誤:在你的問題中,「空的」部分被忽略 - 這就是爲什麼我問。 – kjhughes
即使更正了錯誤消息,對於您發佈的XSD和XML也沒有任何意義。對不起,你可能還有其他東西(除了錯誤信息的尾部)。 – kjhughes