W3C home > Mailing lists > Public > xmlschema-dev@w3.org > June 2011

Re: Choice between complextContent and complexType

From: Mukul Gandhi <gandhi.mukul@gmail.com>
Date: Thu, 16 Jun 2011 14:00:18 +0530
Message-ID: <BANLkTim+Jydk369wUgPK=SMgf1aOk=GXjg@mail.gmail.com>
To: Karl Stubsjoen <kstubs@gmail.com>
Cc: xmlschema-dev@w3.org
On Thu, Jun 16, 2011 at 9:10 AM, Mukul Gandhi <gandhi.mukul@gmail.com> wrote:
>    <xs:complexType name="EXT_formInputTypes">
>          <xs:complexContent>
>                <xs:extension base="formInputTypes">
>                      <xs:attribute name="isExt" type="xs:boolean" default="1"/>
>                </xs:extension>
>          </xs:complexContent>
>    </xs:complexType>

There's a slight correction I would suggest for the above schema
fragment I wrote.

default="1" on xs:attribute won't work I think, since the
xs:alternative has to know the attribute (and it's value) from the
instance document, and then it'll select the type if the corresponding
XPath predicate is true.

Therefore for both the xs:alternative cases I suggested, the attribute
"isExt" should be present in the instance document (with values 1/true
or 0/false) for the example I suggested to work correctly.

I hope this is correct.

Mukul Gandhi
Received on Thursday, 16 June 2011 08:36:02 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:59 UTC