I have code that creates, names, and adds to the the XmlSchema an
XmlSchemaSimpleType. The code then creates an XmlSchemaElement and
sets its SchemaType to the above XmlSchemaSimpleType. It works fine,
but when the document is rendered to XML, XmlSchema creates an inlined
type as well as the global type, as follows.
<xs:schema ...
<xs:element name="RootElem">
<xs:complexType>
<xs:sequence>
<xs:element name="AttrOne">
<xs:simpleType name="AttrOneType">
<xs:restriction base="xs:string" />
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:simpleType name="AttrOneType">
<xs:restriction base="xs:string" />
</xs:simpleType>
</xs:schema>
I want it to render as...
<xs:schema ...
<xs:element name="RootElem">
<xs:complexType>
<xs:sequence>
<xs:element name="AttrOne" type="AttrOneType"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:simpleType name="AttrOneType">
<xs:restriction base="xs:string" />
</xs:simpleType>
</xs:schema>
Does anyone know what I can do to change the way the file gets
rendered?
Thanks!
Eric