XML Schema - Overwrite Element - ComplexType

Discussion in 'XML' started by Istvan, Aug 22, 2006.

  1. Istvan

    Istvan Guest

    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
     
    Istvan, Aug 22, 2006
    #1
    1. Advertising

  2. Istvan

    Istvan Guest

    .....

    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>
     
    Istvan, Aug 22, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Moth
    Replies:
    2
    Views:
    443
  2. Wolfgang
    Replies:
    2
    Views:
    760
    Wolfgang
    Oct 7, 2003
  3. tsolbjor
    Replies:
    0
    Views:
    512
    tsolbjor
    Jul 19, 2004
  4. Peter Theill

    complexType in Xml Schema

    Peter Theill, Nov 25, 2004, in forum: XML
    Replies:
    2
    Views:
    494
    Peter Theill
    Nov 25, 2004
  5. Nicolas Mailhot

    Element + complextype name in xml schema

    Nicolas Mailhot, Apr 8, 2005, in forum: XML
    Replies:
    4
    Views:
    581
    Nicolas Mailhot
    Apr 11, 2005
Loading...

Share This Page