views:

432

answers:

2

Is it possible to have multiple inheritance in XML schemas, if so how?

Example

<xs:schema xmlns:xs="http://www.w3.org/2001/Schema" ....>

 <xs:complexType name="Account">
   <xs:sequence>
     <xs:element name="balance" type="xs:decimal"/>
     <xs:element name="accountNo" type="xs:string"/>
   </xs:sequence>
 </xs:complexType>

 <xs:complexType name="CreditCardAccount">
   <xs:complexContent>
    <xs:extension base="Account">
     <xs:sequence>
      <xs:element name="expiryDate" type="xs:date"/>
      <xs:element name="issuer" type="xs:string"/>
      <xs:element name="type" type="xs:string" use="required"/>
     </xs:sequence>
    </xs:extension>
   <xs:complexContent>
 </xs:complexType>

</xs:schema>

My question is; Is it possible for CreditCardAccount to inherit from multiple types instead of Account only?

+1  A: 

Multiple inheritance of what? If you mean types, then no.

Pavel Minaev
+1 Not much else to say...
skaffman
+1  A: 

No, it's not possible. The XML Schema 1.0 Spec defines that there be only one extension element.

mkoeller