ACMSM2002,
There are a few issues with your schema that you need to fix first.
a) Your schema's type references are not correct. You defined the XMLSchema
namespace as the default namespace. Therefore you need to qualify all the
type names of the types. They are not defined in the XMLSchema namespace,
they belong to
http://www.example.com/IPO. Check where I added the ipo:
prefix to reference the correct namespaces.
b) You need to define top level elements of the XML types that you are
planning to use as classes. The XML type system works slightly different
from the .NET type system. You need to define the concrete elements that an
instance document can contain, not just the types that the document can
contain. Again, see the element definitons I added to your schema.
<schema targetNamespace="http://www.example.com/IPO"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:ipo="http://www.example.com/IPO">
<annotation>
<documentation xml:lang="en">
Addresses for International Purchase order schema
Copyright 2000 Example.com. All rights reserved.
</documentation>
</annotation>
<complexType name="Address">
<sequence>
<element name="name" type="string"/>
<element name="street" type="string"/>
<element name="city" type="string"/>
</sequence>
</complexType>
<complexType name="USAddress">
<complexContent>
<extension base="ipo:Address">
<sequence>
<element name="state" type="ipo:USState"/>
<element name="zip" type="positiveInteger"/>
</sequence>
</extension>
</complexContent>
</complexType>
<!-- other Address derivations for more countries -->
<simpleType name="USState">
<restriction base="string">
<enumeration value="AK"/>
<enumeration value="AL"/>
<enumeration value="AR"/>
<!-- and so on ... -->
</restriction>
</simpleType>
<element name="StateElem" type="ipo:USState" />
<element name="USAddr" type="ipo:USAddress" />
<element name="Addr" type="ipo:Address" />
</schema>
--
HTH
Christoph Schittko [MVP]
Software Architect, .NET Mentor
"ACMSM2002" <m.*******@actosoft.de> wrote in message
news:20****************************@phx.gbl...
Hello,
can xsd.exe generates runtime classes from an XSD schema
containig a super-class and a derived-class?
<MSDN>Xsd.exe only allows you to manipulate XML schemas
that follow the XML Schema Definition (XSD) language
proposed by the World Wide Web Consortium (W3C). For more
information on the XML Schema Definition proposal or the
XML standard, see http://w3.org.</MSDN>
I copied an XSD example from the w3c website.
However xsd.exe" /d /l:VB failed for it...
comments welcome...
(yes, i know that an orm (obj-rel-map) would solve my
problems...)
<schema targetNamespace="http://www.example.com/IPO"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:ipo="http://www.example.com/IPO">
<annotation>
<documentation xml:lang="en">
Addresses for International Purchase order schema
Copyright 2000 Example.com. All rights reserved.
</documentation>
</annotation>
<complexType name="Address">
<sequence>
<element name="name" type="string"/>
<element name="street" type="string"/>
<element name="city" type="string"/>
</sequence>
</complexType>
<complexType name="USAddress">
<complexContent>
<extension base="Address">
<sequence>
<element name="state" type="USState"/>
<element name="zip" type="positiveInteger"/>
</sequence>
</extension>
</complexContent>
</complexType>
<!-- other Address derivations for more countries -->
<simpleType name="USState">
<restriction base="string">
<enumeration value="AK"/>
<enumeration value="AL"/>
<enumeration value="AR"/>
<!-- and so on ... -->
</restriction>
</simpleType>
</schema>