For example. schema 1
<xs:schemaSchema#2
targetNamespace="http://www.xyz.com/PROTO1#"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:cpl="http://www.xyz.com/PROTOCP1#"
xmlns:am="http://www.xyz.com/PROTO1#"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:import namespace="http://www.xyz.com/PROTOCP1#"
schemaLocation="PROTO1.xsd"/>
<xs:element name="AssetMap" type="am:AssetMapType"/>
<xs:complexType name="AssetMapType">
<xs:sequence>
<xs:element name="Id" type="cpl:UUID"/>
<xs:element name="AnnotationText" type="xs:string" minOccurs="0"/>
<xs:element name="VolumeCount" type="xs:positiveInteger"/>
<xs:element name="IssueDate" type="xs:dateTime"/>
<xs:element name="Issuer" type="xs:string"/>
<xs:element name="Creator" type="xs:string"/>
</xs:sequence>
</xs:complexType>
/xs:element>
</xs:schema>
<?xml version="1.0" encoding="UTF-8" ?>Notice elements are not in the same order. I would like to crate a single class to be used for both schemas (if possible) This would be using .net 2.0 using the XMLSerializer. (language is not important)
<xs:schema targetNamespace="http://www.xzz.org/schemas/429" xmlns:am="http://www.xzz.org/schemas/429"
xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:simpleType name="UUID">
<xs:restriction base="xs:anyURI">
<xs:pattern value="urn:uuid:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="AssetMapType">
<xs:sequence>
<xs:element name="Id" type="am:UUID" />
<xs:element name="AnnotationText" type="xs:string" minOccurs="0" />
<xs:element name="Creator" type="xs:string" />
<xs:element name="VolumeCount" type="xs:positiveInteger" />
<xs:element name="IssueDate" type="xs:dateTime" />
<xs:element name="Issuer" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:element name="AssetMap" type="am:AssetMapType" />
</xs:schema>
Can you specify two different namespaces based on some condition?
Other ideas?
Thanks