Sequence indicators are used within element content models to specify the order in which elements may appear . The three sequence indicators available to schema developers are listed below:
Sequence Indicator | Meaning | XML Authority Qlicker |
---|---|---|
| | Can be read as 'or', allowing the document to contain any of the elements or groups of elements listed. | Choices |
, | Can be read as 'followed by,' requiring that the elements or groups of elements appear in the precise sequence indicated. | Sequence |
( ) | Groups elements, allowing a set of choices or a sequence to be used anywhere that a single element can appear. | ( ) |
Some very simple documents can be expressed as a pure sequence. A date might be expressed as a Month, Day, and Year element, for example. This could be done using the comma sequence indicator:
(Month, Day, Year)
In other cases, a document needs to provide choices. A chapter might require an introduction, but then permit any combination of sections or sidebars. Sequence indicators, in combination with occurrence indicators, can make this possible. The content model for a chapter element might therefore look like:
(Intro, (Section | Sidebar)*)
The Intro element could appear once (and only once) at the start of the chapter, and then Section or Sidebar elements could follow in any order. (This model is read as "an Intro element followed by zero or more Section or Sidebar elements".)
Copyright 2000 Extensibility, Inc.
Suite 250, 200 Franklin Street, Chapel Hill, North Carolina 27516