W3C home > Mailing lists > Public > xmlschema-dev@w3.org > October 2003

RE: extension of an abstract complexType

From: Lemmin, Harald <Harald.Lemmin@softwareag.com>
Date: Wed, 15 Oct 2003 10:17:57 +0200
Message-ID: <DFF2AC9E3583D511A21F0008C7E6210606E34D43@daemsg02.software-ag.de>
To: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>
Hello,
 
you have to use complexType simpleContent. You can derive this from your
abstract complex type:
 
  <xs:complexType name = "integerTimePoint">
    <xs:simpleContent>
      <xs:restriction base = "timePoint">
        <xs:simpleType>
          <xs:restriction base = "xs:integer"></xs:restriction>
        </xs:simpleType>
      </xs:restriction>
    </xs:simpleContent>
  </xs:complexType>

By the base "timePoint" the attribute is inherited and by the local
simpleType the type of the simple type content is defined.
But now you cannot add any complex content anymore, because its simple
content.
 
Kind regards,
Harald
 
 
 

-----Original Message-----
From: koen casier [mailto:koen.casier@intec.ugent.be]
Sent: Mittwoch, 15. Oktober 2003 10:07
To: xmlschema-dev@w3.org
Subject: extension of an abstract complexType


Hello,



I have the following XML_schema:
        <xsd:complexType name="timePoint" abstract="true">
                <xsd:attribute name="closed" use="required"
type="xsd:boolean"/>
        </xsd:complexType>

        <xsd:complexType name="integerTimePoint">
                <xsd:complexContent>
                        <xsd:extension base="timePoint">
                                <xsd:sequence  minOccurs="1" maxOccurs="1">
                                        <xsd:element name="value"
type="xsd:integer" 
 
minOccurs="1" maxOccurs="1"/>
                                </xsd:sequence> 
                        </xsd:extension>
                </xsd:complexContent>
        </xsd:complexType>


This way the integerTimePoint is represented as:
        <tagName closed="true/false" xsi:type="integerTimePoint">
                <value>
                        5
                </value>
        </tagName>

But I would like the integerTimePoint to be represented as:
        <tagName closed="true/false" xsi:type="integerTimePoint">
                5
        </tagName>
With the restriction that the actual content between the tags 'tagName' 
is a xsd:integer.

Can anyone help me out here please,



thanks, 
Koen 
Received on Wednesday, 15 October 2003 04:18:20 GMT

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