XSD combining 2 elements
Posted: Fri Aug 20, 2004 7:06 pm
Hi,
I've got al list of possible combinations of brands and models
I want to use xsd to verify if the combination is ok
can I do this using XSD?
thanks
example:
xsd:
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="CAR">
<xs:complexType>
<xs:all>
<xs:element name="BRAND" />
<xs:element name="MODEL" />
</xs:all>
</xs:complexType>
</xs:element>
</xs:schema>
xml:
<CAR>
<BRAND>MASERATI</BRAND>
<MODEL>DB9</BRAND>
</CAR>
I've got al list of possible combinations of brands and models
I want to use xsd to verify if the combination is ok
can I do this using XSD?
thanks
example:
xsd:
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="CAR">
<xs:complexType>
<xs:all>
<xs:element name="BRAND" />
<xs:element name="MODEL" />
</xs:all>
</xs:complexType>
</xs:element>
</xs:schema>
xml:
<CAR>
<BRAND>MASERATI</BRAND>
<MODEL>DB9</BRAND>
</CAR>