XML Schema - Overwrite Element - ComplexType

I

Istvan

Hi !

Can somebody tell me if it's possible to overwrite an element
definition when I derive an complexType (with extension, or something
like this ) ?

The base complexType looks like:

<xs:complexType name="statechangetype">
<xs:sequence>
<xs:element name="Name" type="xs:string"/>
<xs:element name="State" type="statetype"/>
<xs:element name="Condition" type="conditiontype" minOccurs="0"
maxOccurs="unbounded"/>
<xs:element name="When" type="whentype" minOccurs="0"/>
<xs:element name="Restriction" type="restrictiontype" minOccurs="0"
maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>

and in the derived complexType, I want to overwrite the element from
the base complexType "State" like this way:

<xs:complexType name="bubblestatechangetype">
<xsd:extension base="statechangetype">
<xs:sequence>
<xs:element name="State" type="bubblevaluetype"/>
</xs:sequence>
</xsd:extension>
</xs:complexType>


Thanks.

Best regards, Istvan
 
I

Istvan

.....

This type "statetype":

<xs:simpleType name="statetype">
<xs:restriction base="xs:string">
<xs:enumeration value="R"/>
<xs:enumeration value="O"/>
<xs:enumeration value="F"/>
</xs:restriction>
</xs:simpleType>

should be replaced by "bubblevaluetype" :

<xs:simpleType name="bubblevaluetype">
<xs:restriction base="xs:integer">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="300"/>
</xs:restriction>
</xs:simpleType>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top