All groups

It is entirely possible that both the Choice and Sequence elements will be inadequate to accurately model a required structure. Consider the need for a book cover to contain a title, author name and publisher name, but for the order of these three items to be unconstrained, so that a document instance author can decide which should appear first and last. The Sequence element would be too restrictive, and the Option element, which would need to be allowed to repeat, would not be restrictive enough (it would, for example, allow two titles to appear). What is needed is a construct that specifies a list of required elements, but does not dictate the order in which they should occur, and the All element is designed for this purpose:

 <complexType> ...

Get XML Companion, The, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.