Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Error does not compile xml by <xsd:simpleType> tag

I try to add a new list to my xml to generate some classes for a service, but when I add this xml fragment it gives me an error in the tags that are inside xsd:sequence all xsd:simpleType. This is the error message that tells me:

s4s-elt-must-match.1: The content of ‘sequence’ must match
(annotation?, (element | group | choice | sequence | any)*). A
problem was found starting at: simpleType.

And this is how I have built the xml snippet built

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

   <xsd:complexType name="RegisterEventsSubRequestType">
      <xsd:sequence>
         <xsd:element name="Canal" type="xsd:integer"></xsd:element>
         <xsd:element name="Ean13" type="xsd:integer"></xsd:element>
         <xsd:simpleType>
               <xsd:restriction base="xsd:integer">
                  <xsd:totalDigits value="13"/>
               </xsd:restriction>
         </xsd:simpleType>
         <xsd:element name="Center" type="xsd:integer"></xsd:element>
         <xsd:simpleType>
               <xsd:restriction base="xsd:integer">
                  <xsd:totalDigits value="4"/>
               </xsd:restriction>
         </xsd:simpleType>
         <xsd:element name="Date" type="xsd:dateTime"></xsd:element>
         <xsd:element name="SubColectives" type="tns:SubColectivesType"/>
      </xsd:sequence>
   </xsd:complexType> 

What is the error due to? How could I solve it? I thought that adding a name attribute would solve it, but it hasn’t let me.

>Solution :

A sequence cannot contain a loose simpleType declaration.

You probably meant to write

  <xsd:complexType name="RegisterEventsSubRequestType">
     <xsd:sequence>
        <xsd:element name="Canal" type="xsd:integer"></xsd:element>
        <xsd:element name="Ean13">
           <xsd:simpleType>
                 <xsd:restriction base="xsd:integer">
                    <xsd:totalDigits value="13"/>
                 </xsd:restriction>
           </xsd:simpleType>
        </xsd:element>
        <xsd:element name="Center">
            <xsd:simpleType>
                  <xsd:restriction base="xsd:integer">
                     <xsd:totalDigits value="4"/>
                  </xsd:restriction>
            </xsd:simpleType>
        </xsd:element>
        <xsd:element name="Date" type="xsd:dateTime"></xsd:element>
        <xsd:element name="SubColectives" type="tns:SubColectivesType"/>
     </xsd:sequence>
  </xsd:complexType> 
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading