Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


[XML Schema 1.1] A little confused about inheritable attributes

From: "Costello, Roger L." <costello@-----.--->
To: "xmlschema-dev@--.---" <-------------@--.--->
Date: 6/29/2009 5:48:00 PM
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">
    <complexType>
        <sequence>
            <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" />
            </xs:element>
        </sequence>
        <attribute name="start-time" type="xs:time" use="required" inheritable="true" />
        <attribute name="end-time" type="xs:time" use="required" inheritable="true" />
    </complexType>
</element>

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

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

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

</Meeting>



/Roger


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent