Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: [XML Schema 1.1] Multiple elements apply ... which

From: "Michael Kay" <mike@--------.--->
To: "'Costello, Roger L.'" <costello@-----.--->, <xmlschema-dev@--.--->
Date: 7/1/2009 11:03:00 PM
See section 3.3.4.1:

[Definition:]   Given a Type Table T and an element information item E, T
conditionally selects a type S for E in the following way. The {test}
expressions in T's {alternatives} are evaluated, in order, until one of the
Type Alternatives .successfully selects. a type definition for E, or until
all have been tried without success. 

> Suppose that several <alternative> elements apply. Which one 
> will be used? 

So the answer is: the first one.

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 


> -----Original Message-----
> From: xmlschema-dev-request@w... 
> [mailto:xmlschema-dev-request@w...] On Behalf Of Costello, Roger L.
> Sent: 01 July 2009 21:23
> To: xmlschema-dev@w...
> Subject: [XML Schema 1.1] Multiple <alternative> elements 
> apply ... which one wins?
> 
> 
> Hi Folks,
> 
> 
> Example: the below <Beverage> element has two <alternative> 
> elements. If the value of its current-time attribute is 
> 08:00:00 then both <alternative> elements apply. Which one 
> will be used?
> 
> <xs:element name="Beverage" type="BeverageType">
>     <xs:alternative test="@current-time le '12:00:00'" 
> type="MorningBeverage" />
>     <xs:alternative test="@current-time le '09:00:00'" 
> type="EarlyMorningBeverage" /> </xs:element>
> 
> /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