W3C home > Mailing lists > Public > xmlschema-dev@w3.org > April 2007

How to take union of elements inside two different complex types?

From: nandanprasad <pola_nandana@emc.com>
Date: Mon, 16 Apr 2007 03:04:45 -0700 (PDT)
Message-ID: <10013359.post@talk.nabble.com>
To: xmlschema-dev@w3.org


I've an xsd CIM_ManagedSystemElement.xsd in which the following is defined.

<xs:complexType name="CIM_ManagedSystemElement_Type">
        <xs:sequence>
            <xs:element ref="class:HealthState" minOccurs="0"/>
            <xs:element ref="class:InstallDate" minOccurs="0"/>
            <xs:element ref="class:Name" minOccurs="0"/>
            <xs:element ref="class:OperationalStatus" maxOccurs="unbounded"
minOccurs="0"/>
            <xs:element ref="class:Status" minOccurs="0"/>
            <xs:element ref="class:StatusDescriptions" maxOccurs="unbounded"
minOccurs="0"/>
            <xs:any namespace="##other" processContents="lax" minOccurs="0" 
                    maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:anyAttribute namespace="##any" processContent="lax"/>
    </xs:complexType>
     <xs:element name="CIM_ManagedSystemElement"
type="class:CIM_ManagedSystemElement_Type"/>

and another xsd named CIM_ManagedElement.xsd with the follwoing content:

<xs:complexType name="CIM_ManagedElement_Type">
        <xs:sequence>
            <xs:element ref="class:Caption" minOccurs="0"/>
            <xs:element ref="class:Description" minOccurs="0"/>
            <xs:element ref="class:ElementName" minOccurs="0"/>
            <xs:any namespace="##other" processContents="lax" minOccurs="0" 
                    maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:anyAttribute namespace="##any" processContents="lax"/>
    </xs:complexType>
<xs:element name="CIM_ManagedElement" type="class:CIM_ManagedElement_Type"/>

Now, I want to relate these two xsd's elements(as CIM_ManagedSystemElement
extends CIM_ManagedElement) inside a third xsd, called cls_hierarchy.xsd.
i.e CIM_ManagedSystemElement element must include the elements inside the
CIM_ManagedElement also.

How can I do this?? please help.

-- 
View this message in context: http://www.nabble.com/How-to-take-union-of-elements-inside-two-different-complex-types--tf3583517.html#a10013359
Sent from the w3.org - xmlschema-dev mailing list archive at Nabble.com.
Received on Monday, 16 April 2007 10:04:52 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:59 GMT