Next in thread →
Next in month →
Re: [xml-dev] xml element naming
These are definitely all separate occurrences of the same element. So in
this case, you could declare a global "price" element and reference it
in 3 places as follows:
<xs:element name="price" type="xs:double"/> <!-- Global declaration -->
<xs:element name="suit">
<xs:complexType>
<xs:sequence>
<xs:element ref="price"/>
<xs:element name="top">
<xs:complextype>
<xs:sequence>
<xs:element ref="price"/>
<xs:element name="fabric" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="trousers">
<xs:complexType>
<xs:element ref="price"/>
<xs:complexType>
<xs:element>
</xs:sequence>
</xs:complexType>
</element>
...
</schema>
This way, if you change the datatype of "price" in the future, it will
propagate to all the references.
Kind Regards,
Joe Chiusano
Booz | Allen | Hamilton
Next in thread →
Next in month →