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

Wizard Error E2001


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


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 optimiser will determine that none of the declared complexTypes will never be utilised.


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="" elementFormDefault="qualified" attributeFormDefault="unqualified">
  <xs:complexType name="Item">
      <xs:element name="Description" type="xs:string"/>
      <xs:element name="Quantity" type="xs:unsignedLong"/>
  <xs:complexType name="QuotedItem">
      <xs:element name="Item" type="Item"/>
      <xs:element name="PricePerItemInPence" type="xs:unsignedLong" minOccurs="0"/>
      <xs:element name="CurrentAvalibility" type="xs:unsignedLong" minOccurs="0"/>

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

  <xs:element name="QuoteRequest">
        <xs:element name="CustomerID" type="xs:string"/>
        <xs:element name="Item" type="Item" minOccurs="0" maxOccurs="unbounded"/>

See Also

Elements vs complexTypes