I have an element in my schema <service> which has an attribute called "type". So you can have <service type="request">, <service type="change"> etc. Request and Change both have different sets of tags in them. I have written a schema for where type=change (see below), but I'm not sure how to add Request to it. Can anybody help me out?
<xs:element name="service">
<xs:complexType>
<xs:sequence>
<xs:element name="info" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="number" type="xs:long" minOccurs="1" />
<xs:element name="subcug" type="xs:long" minOccurs="0" />
<xs:element name="pay" type="xs:string" minOccurs="0" />
<xs:element name="currency" type="xs:string" minOccurs="0" />
<xs:element name="language" type="xs:string" minOccurs="0" />
<xs:element name="cash" type="xs:float" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="type" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="change" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
Thanks,
lfc77
<xs:element name="service">
<xs:complexType>
<xs:sequence>
<xs:element name="info" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="number" type="xs:long" minOccurs="1" />
<xs:element name="subcug" type="xs:long" minOccurs="0" />
<xs:element name="pay" type="xs:string" minOccurs="0" />
<xs:element name="currency" type="xs:string" minOccurs="0" />
<xs:element name="language" type="xs:string" minOccurs="0" />
<xs:element name="cash" type="xs:float" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="type" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="change" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
Thanks,
lfc77