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

[XML Schema 1.1] A little confused about inheritable attributes

From: Costello, Roger L. <costello@mitre.org>
Date: Mon, 29 Jun 2009 13:46:10 -0400
To: "xmlschema-dev@w3.org" <xmlschema-dev@w3.org>
Message-ID: <9E51F88D5247B648908850C35A3BBB500400458C2E@IMCMBX3.MITRE.ORG>

Hi Folks,

I know that by declaring an attribute to be inheritable, nested elements can use the attribute in their <assert> and <alternative> elements.

But suppose an attribute is declared to be both inheritable and required (use="required"). Does that mean nested elements must display that attribute in instance documents?

For example, <Meeting> has two required, inheritable attributes:

<element name="Meeting">
            <element name="Beverage" type="b:BeverageType">
               <alternative test="@end-time le '12:00:00'" type="b:MorningBeverage" />
               <alternative test="@end-time gt '12:00:00'" type="b:AfternoonBeverage" />
        <attribute name="start-time" type="xs:time" use="required" inheritable="true" />
        <attribute name="end-time" type="xs:time" use="required" inheritable="true" />

In an instance document must the <Beverage> element have the two inherited attributes:

<Meeting start-time="___" end-time="___">

    <Beverage start-time="___" end-time="___">


Received on Monday, 29 June 2009 17:46:45 UTC

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