XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] Use-case for a complex type that has no valid content?

The main use of a void type is that it helps you construct a system with closure properties, so you can have operators on types (e.g. the intersection of two types) where the result of the operation is always a legitimate type.

Use-cases are the bane of orthogonality. Any system with good orthogonality can do things for which it is very difficult to find a use case. What’s the use case for adding two negative numbers? Design focused excessively on use-cases leads to a lack of orthogonality.

XSD 1.1 introduced xs:error which is a void simple type. It’s defined similarly to <xs:choice/> as a union with no member types. The specific use case for introducing it was for conditional type assignment, it allows you to have the last alternative in a list of alternatives say “if none of the above conditions is true, then the type is xs:error, meaning no content is accepted”.

Michael Kay
Saxonica


On 2 Jun 2015, at 18:44, Costello, Roger L. <costello@mitre.org> wrote:

Hi Folks,

 

Thanks for the outstanding responses.

 

I have learned that an empty choice:

 

    <xs:complexType name="ValidationKiller">
       
<xs:choice/>
   
</xs:complexType>

 

has no valid content, i.e., the set of valid content is the empty set, {}.

 

When would one use such a complex type? Can you think of a use-case for it?

 

/Roger




[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS