Page last modified 14:46, 28 Mar 2014 by jukkam

cvc-elt-4-3

    Version as of 07:43, 27 Jun 2022

    to this version.

    Return to Version archive.

    View current version

    General description of the error:

    The format of the error message: cvc-elt.4.3: Type ''{1}'' is not validly derived from the type definition, ''{2}'', of element ''{0}''.

    Error description in schema standard: http://www.w3.org/TR/2007/WD-xmlschema11-1-20070830/#cvc-elt

    Possible causes for this error:

    • File has an element with a type that is not extended (derived) from the base datatype.
    An example
    Schema would be along with:

    <xsd:element name="directory">
      <xsd:complexType>
         <xsd:sequence>
            <xsd:element name="contact" type="contactType" minOccurs="0" maxOccurs="unbounded"/>
         </xsd:sequence>
       </xsd:complexType>
    </xsd:element>
    <!-- Defining the base datatype -->
    <xsd:complexType name="
    contactType">
      <xsd:sequence>
         <xsd:element name="name" type="xsd:string"/>
      </xsd:sequence>
    </xsd:complexType>
    <!-- Defining a derived datatype -->
    <xsd:complexType name="emailContactType">
       <xsd:complexContent>
           
    <xsd:extension base="contactType">
                <xsd:sequence>
                    <xsd:element name="email" type="xsd:string"/>
                </xsd:sequence>
            </xsd:extension>
       </xsd:complexContent>
    </xsd:complexType>

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    Valid file would be:
    <directory xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <contact xsi:type="emailContactType">
            <email>email@server.com</email>
        </contact>
    </directory>

     

     

     

     

     

    In this case the 'webContactType' is not defined as extension like in the previous example.

    <directory xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <contact xsi:type="webContactType">
            <email>email@server.com</email>
        </contact>
    </directory>

     

     

     

     

     

    Error message: Error cvc-elt.4.3: Type 'webContactType' is not validly derived from the type definition, 'contactType', of element 'contact'.

    How to fix: The error can be corrected by looking up the schema and checking what elements can be used. Usable elements are those that are derived from base datatype with:

    <xsd:extension base="contactType">
     
    Menu