Schema Documentation - DIAGRAM Description Profile
version 1.0

The block variant of the code element

On this page:

The code element is intended for general instances of code as found in works of fiction and similar non-technical documents, which includes computer programming code, commands and command input/output as well as representations of numeric and text coding systems, such as Morse code.

For computer programming books, manuals and specifications, specializing the code element or using a computer markup feature is recommended.

Usage Example

<code>
    <lngroup>
        <ln>public static void helloWorld() {</ln>
        <ln>    Console.Write("Hello World!");</ln>
        <ln>}</ln>
    </lngroup>
</code>
    

Allowed parents

annotation, m:annotation-xml, aside, block, caption, description, item, d:longdesc, note (block variant), note (phrase variant), object, quote, section, d:simplifiedLanguageDescription, d:summary, td, th and d:tour

Allowed children

This element must not contain text.

This element may contain the following children: block, hd, ln, lngroup, object, p and pagebreak

Content model and additional requirements

a choice of
either
one or more of
any of the 3 elements: ln, lngroup and pagebreak
or
one or more of
any of the 5 elements: block, hd, object, p and pagebreak
end of choice
Note that in addition to restrictions presented in the content model above, use of this element must also respect the following requirement:
  • The code element must neither be empty nor contain only whitespace.
Such requirements take precedence over any conflicting statements in the content model or in the lists above of allowed children and parents.

Variants

This element exists in 2 variants. The other variant is the phrase variant.

Namespace

http://www.daisy.org/ns/z3998/authoring/