Using styleVision Get the error "the content model of complex type definition ' anonymous ' "

316 views Asked by At

Hi i am using the StyleVision tool. I am validating the xml files against XSD. WHen i run it says "the content model of complex type definition ' anonymous ' ". But my XML file validates against the XSD. What am i doing wrong kindly correct me. My XML and XSD is given below

   <?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>

1

There are 1 answers

4
kjhughes On

You appear to have cut off the end of your error message; what you've posted is merely a reference rather than a complete statement.

Nevertheless, the phrase the content model of complex type definition 'anonymous' refers to an unnamed type definition, which, in your case, is:

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

This is contrasted with a named type definition such as

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

which could be referenced like this:

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

Hopefully this explanation of what is meant by anonymous helps you understand the rest of your error message. If not, please update your question with the complete error message and any supplemental files that someone knowledgeable in StyleVision would need to help you further.