<preformat>

Preformatted Text

Definition

Used for preformatted text, such as computer code, in which white space (such as tabs, line feeds, and spaces) should be preserved

This element’s content typically is displayed or printed in a monofont to preserve character alignment.

Remarks

Conversion Note: The position attribute may be used to indicate whether this element must be anchored at its exact location within the text or whether it may float, for example, to the top of the next page, next column, to the end of a logical file, or within a separate window. For the typical <preformat> element, the “float or anchor” decision will be governed by the size of the object. For example, short code fragments are typically anchored whereas full programs are typically placed elsewhere such as in a separate window or at the end of the article.

Attributes

alternate-form-of Alternate Form of Graphic, Media Object, Etc.
id Identifier
position Position
preformat-type Type of Preformatted Text
xml:lang Language
xml:space Space

Related Elements

Conversion Note: Poetry may be tagged with the <preformat> element if spacing is critical, but usually poetry should be tagged with the <verse-group> <verse-group> element, which may not preserve the exact indentation, but is likely to be displayed in a proportional font.

Model Information

Content Model

<!ELEMENT  preformat    %preformat-model;                            >

Description

Any combination of:

This element may be contained in:

<app> Appendix; <app-group> Appendix Matter; <body> Body of the Article; <boxed-text> Boxed Text; <chem-struct> Chemical Structure (Display); <chem-struct-wrapper> Chemical Structure Wrapper; <disp-formula> Formula, Display; <disp-quote> Quote, Displayed; <fig> Figure; <floats-wrap> Floats Wrapper; <gloss-group> Glossary Group; <glossary> Glossary Elements List; <named-content> Named Special (Subject) Content; <notes> Notes; <p> Paragraph; <ref-list> Reference List (Bibliographic Reference List); <sec> Section; <supplementary-material> Supplementary Material; <table-wrap> Table Wrapper; <td> Table Data Cell (XHTML table model); <term> Definition List: Term; <th> Table Header Cell (XHTML table model)

Tagged Examples

Example 1


<article>
<front>...</front>
<body>
...
<p>Trees, of course, are hardly a random choice for our 
methodology.... Hierarchical trees have been understood as a 
way of viewing document structures since the earliest days of 
SGML development. Our initial tree structure was very simple:
<preformat>
&lt;!ELEMENT  implications  (tree+) &gt;
&lt;!ELEMENT  tree          (root, branches) &gt;
&lt;!ELEMENT  root          (term, synonym?) &gt;
&lt;!ELEMENT  branches      (term | (term, synonym) | tree)* &gt;
</preformat>
Terms are the literal strings for which the Ferret engine searches; they 
are the most specific expressions to be found in real documents of the 
concepts on which classifications rules act.</p>
...
</body>
<back>...</back>
</article> 


Example 2


...
<p>As you can see in the following excerpt, use of literal
result elements is very convenient:
<preformat>
&lt;xsl:template match="div/divhead" priority="2"&gt;
  &lt;<bold>h2</bold>&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;<bold>/h2</bold>&gt;
&lt;/xsl:template&gt;
</preformat>
</p>
...


Module

display.ent