XSD.Exe error: Error generating classes for schema 'xxxxxxx'. - Specified cast is not valid.

  • Thread starter Thread starter eSapient
  • Start date Start date
E

eSapient

I get the following error when I run the XML Schema Definition Tool on
a XML schema:

Error: Error generating classes for schema 'codeGeoFeatureType'.
- Specified cast is not valid.

The XSD in question is:

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xsd:element name="codeGeoFeatureType" type="codeTypeGeoFeature"
default="POLYGON">
</xsd:element>
<xsd:simpleType name="codeTypeGeoFeatureBase">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="POLYGON"/>
<xsd:enumeration value="LINE"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="codeTypeGeoFeature">
<xsd:simpleContent>
<xsd:extension base="codeTypeGeoFeatureBase"/>
</xsd:simpleContent>
</xsd:complexType>
</xsd:schema>

Can anybody help by offering suggestions or workarounds?

Thanks in advance.
 
I found that if I removed 'default="POLYGON"' from the
XSD, I did not get any error.
 
Back
Top