Liquid XML Data Binder 2020
Liquid XML Data Binding Wizard / Errors and Warnings / E2001
In This Topic
    E2001
    In This Topic

    Error Message

    The schema does not contain any 'elements' so will not generate any classes.

    Explanation

    Xml Schema elements can be considered as objects that have a type defined by the simple and complex types. So if no elements are specified in the schema, no classes will be generated as the optimizer will determine that none of the declared complexTypes will never be utilized.

    Solution

    The solution is to declare elements within the schema.

    E.g. The following Xml Schema (XSD) will not generate any classes as no elements are defined.

    <?xml version="1.0" encoding="utf-8"?>
      <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
      <xs:complexType name="Item">
        <xs:sequence>
          <xs:element name="Description" type="xs:string"/>
          <xs:element name="Quantity" type="xs:unsignedLong"/>
        </xs:sequence>
      </xs:complexType>
      <xs:complexType name="QuotedItem">
        <xs:sequence>
          <xs:element name="Item" type="Item"/>
          <xs:element name="PricePerItemInPence" type="xs:unsignedLong" minOccurs="0"/>
          <xs:element name="CurrentAvalibility" type="xs:unsignedLong" minOccurs="0"/>
        </xs:sequence>
      </xs:complexType>
    </xs:schema>
    

    However, by extending the schema to define the element QuoteRequest and its associated child elements, a full class hierarchy will be generated:

    <?xml version="1.0" encoding="utf-8"?>
      <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
      <xs:complexType name="Item">
        <xs:sequence>
          <xs:element name="Description" type="xs:string"/>
          <xs:element name="Quantity" type="xs:unsignedLong"/>
        </xs:sequence>
      </xs:complexType>
      <xs:complexType name="QuotedItem">
        <xs:sequence>
          <xs:element name="Item" type="Item"/>
          <xs:element name="PricePerItemInPence" type="xs:unsignedLong" minOccurs="0"/>
          <xs:element name="CurrentAvalibility" type="xs:unsignedLong" minOccurs="0"/>
        </xs:sequence>
      </xs:complexType>
      <!-- Add Element QuoteRequest -->
      <xs:element name="QuoteRequest">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="CustomerID" type="xs:string"/>
            <xs:element name="Item" type="Item" minOccurs="0" maxOccurs="unbounded"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:schema>