Strange XML Schema Definition Tool (Xsd.exe) bug

  • Thread starter Jörg-Ulrich Wölfel
  • Start date
J

Jörg-Ulrich Wölfel

The simple reduced XML-schema at the end is valid according to Visual Studio
built in validator and also according to XML-Spy. In addition it is deduced
from constructs used in a standard.

Using the XML Schema definition tool (xsd.exe) of the .NET framework SDK to
generate C#-classes correct result for that XML-schema are produced.
Using the same tool with the same XML-schmema to generate ADO.Net datasets
(switch /d instead of /c) brings up the following error message:

"undefined data type: 'Type1' " (translated from German error message).

Still more strange, having removed the Element2 from the XML-schema
everything goes well, a correct dataset is generated. But Element2 should
not have any impact on the outcome!

Any ideas or help?
Thanx
Jörg-Ulrich Wölfel

<?xml version="1.0" encoding="UTF-8" ?>
<xsd:schema targetNamespace="http://www.example.org/strangebug"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.example.org/strangebug">

<xsd:simpleType name="Type1">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="250" />
</xsd:restriction>
</xsd:simpleType>
<xsd:element name="Element1">
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="Type1"></xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="Element2"></xsd:element>
</xsd:schema>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top