<example>
The <example> element is a section that contains examples that
illustrate or support the current topic.
Use <example> to contain both sample code (or similar artifacts) and the
discussion that illustrates the sample. For example, a DITA topic about programming code
could use the <example> element to contain both the sample code and
the text that describes the code. Similarly, a sample that included preformatted text might
use the <pre> element along with a paragraph or list to elaborate
upon sections of that text.
Content models
See appendix for information about this element in OASIS document type shells.
Inheritance
- topic/example
Example
This section is non-normative.
<example id="example">
<title>Example</title>
<codeblock><p>Example of the p element</p></codeblock>
</example>Content model
(Text | <dl> | <div> | <fig> | <image> | <lines> | <lq> | <note> | <object> | <ol> | <p> | <pre> | <simpletable> | <sl> | <table> | <ul> | <boolean> | <cite> | <keyword> | <ph> | <q> | <term> | <text> | <tm> | <xref> | <state> | <data> | <data-about> | <foreign> | <unknown> | <title> | <draft-comment> | <fn> | <indextermref> | <indexterm> | <required-cleanup>)*
Contained by
<body>
- Text
<boolean><cite><data><data-about><div><dl><draft-comment><fig><fn><foreign><image><indexterm><indextermref><keyword><lines><lq><note><object><ol><p><ph><pre><q><required-cleanup><simpletable><sl><state><table><term><text><title><tm><ul><unknown><xref>
Contained by
<body>
Inheritance
- topic/example
The <example> element is a base element type. It is defined in the topic module.
Attributes
The following attributes are available on this element: Universal attribute group, outputclass, and spectitle.