I am trying to use the xml desinger in .net 1.1 to create
the follow schema. where USAddress is derived from Address
But when I generate the xml file, the .net xml editor says
"The active schema does not support the element 'street'"
The schema is from a msdn .net example.
What I am missing here?
Thanks
John
Here are the xml file and xsd file:
Here is the xml file:
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema id="MySchema"
targetNamespace="http://tempuri.org/MySchema.xsd"
elementFormDefault="qualified"
xmlns="http://tempuri.org/MySchema.xsd"
xmlns:mstns="http://tempuri.org/MySchema.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="address">
<xs:sequence>
<xs:element name="street"
type="xs:string" />
<xs:element name="city"
type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="USAddress">
<xs:complexContent>
<xs:extension base="address">
<xs:sequence>
<xs:element
name="state" type="xs:string" />
</xs:sequence>
<xs:attribute
name="country" type="xs:string" fixed="US" />
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="USA"
type="USAddress"></xs:element>
</xs:schema>
Here is a schema saved as MySchema.xsd
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema id="MySchema"
targetNamespace="http://tempuri.org/MySchema.xsd"
elementFormDefault="qualified"
xmlns="http://tempuri.org/MySchema.xsd"
xmlns:mstns="http://tempuri.org/MySchema.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="address">
<xs:sequence>
<xs:element name="street"
type="xs:string" />
<xs:element name="city"
type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="USAddress">
<xs:complexContent>
<xs:extension base="address">
<xs:sequence>
<xs:element
name="state" type="xs:string" />
</xs:sequence>
<xs:attribute
name="country" type="xs:string" fixed="US" />
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="USA"
type="USAddress"></xs:element>
</xs:schema>