Re: Choice between complextContent and complexType

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

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