Required and sequential context

Optional elements

An element may be optional in some (or even all) contexts. This can be a factor in stylesheet design. For example, it would not be a good idea to arrange for a chapter Title element to force a page-break to start the new chapter, when the Title element is optional. If an element name is followed by a question mark, it is optional. In the following example, the title is optional within a Note element:

<!ELEMENT Note (Title? ...)>

The asterisk symbol is used to indicate that an element is repeatable but also optional. The Para element in the example below is therefore optional, and the note could be empty:

<!ELEMENT Note (Para*)>

Element Ordering

An element model may include elements that can ...

Get XSL companion, The 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.