I hope this explanation is clear. It might not even be possible but any opinion is welcome.
Im working on modeling some switches for configuration information. The model we are going with is to describe switches just like part of the OSI model, thus we have a physical, link, network, ect.. entity. Thus far I have the following start for physical:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Root">
<xs:complexType>
<xs:sequence>
<xs:element name="System" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:all>
<xs:element name="Physical">
<xs:annotation>
<xs:documentation>OSI Layer 1: hardware</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element ref="Element" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:all>
</xs:complexType>
</xs:element>
<xs:element name="Customer" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="Element">
<xs:sequence>
<xs:element name="Shelf" type="Shelf" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Shelf">
<xs:sequence>
<xs:element name="Slot" type="Slot" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Slot">
<xs:sequence>
<xs:element name="Card" type="Card"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Card">
<xs:sequence>
<xs:element name="Port" type="Port" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Port"/>
<xs:element name="Element" type="Element">
<xs:annotation>
<xs:documentation>There are many different kinds of elements, but in this cut we are only covering the core router.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:schema>
What I would like to do is to leave card a generic type as shown but have restrictions that shows cards based on the slot type. For example, if you have a slot instance 2, then 64 bit card types are allowed to be put in this slot. Course this assumes I have a key id of number for the slot.
Any help is appreciated. Thanks.