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

Re: Choice between complextContent and complexType

From: Karl Stubsjoen <kstubs@gmail.com>
Date: Thu, 16 Jun 2011 09:28:02 -0700
Message-ID: <BANLkTinp-pwC_-wpwa6HefWii3=RMbKkPA@mail.gmail.com>
To: Mukul Gandhi <gandhi.mukul@gmail.com>
Cc: xmlschema-dev@w3.org
Thanks for the followup on this Mukul.

On Thu, Jun 16, 2011 at 1:30 AM, Mukul Gandhi <gandhi.mukul@gmail.com> wrote:
> 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.
>
>
>
>
> --
> Regards,
> Mukul Gandhi
>



-- 
Karl Stubsjoen
MeetScoresOnline.com
(602) 845-0006
Received on Thursday, 16 June 2011 16:28:38 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 16 June 2011 16:28:39 GMT