◇◆
<preformat> Preformatted Text
Text in which spaces, tabs, and line feeds must be preserved. Content is typically
displayed in monofont to preserve character alignment.
Usage/Remarks
The <preformat> element is typically used for machine-related communication such as ASCII art and
error
message reports, in which whitespace such as tabs, line feeds, and spaces should be
preserved.
Position
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 preformat fragments are typically anchored whereas longer
preformatted material is typically placed elsewhere such as in a separate window or
at the end of the document.
Equations
The MathML elements to describe equations are not permitted within <preformat>. If equations are encountered within computer code, they
can be tagged using the element <named-content> to
preserve the fact that they were equations or the element <styled-content> to preserve the fact that they were set in a math font.
When Content is a Form
Two attributes are available to describe the preformatted object when it contains
a form:
- @is-form can indicate that the preformat contains a form. What constitutes a “form” is not defined by NISO STS.
- @form-type can identify the type of the form. If the form is not one of the listed types, @custom-type may provide the type (see below).
Custom Form Type (@custom-type)
@form-type has as its values a fixed list of form types. If your form is not one of the listed
types, you can use @custom-type to describe the form type. Set the value of @form-type to “custom” and also use @custom-type to hold any form type you require. For example:
<preformat is-form="form" form-type="custom" custom-type="template"...>...</preformat>
Attributes
orientation (default = portrait)
position (default = float)
Miscellaneous non-STS-specific Attributes
xml:space (fixed value = preserve)
Models and Context
May be contained in
<ack>, <alternatives>, <app>, <app-group>, <bio>, <body>, <boxed-text>, <chem-struct>, <chem-struct-wrap>, <disp-formula>, <disp-quote>, <fig>, <glossary>, <index>, <index-div>, <index-group>, <license-p>, <named-content>, <non-normative-example>, <non-normative-note>, <normative-example>, <normative-note>, <notes>, <p>, <ref-list>, <sec>, <see>, <see-also>, <see-also-entry>, <see-entry>, <styled-content>, <supplementary-material>, <table-wrap>, <tbx:crossReference>, <tbx:definition>, <tbx:entailedTerm>, <tbx:example>, <tbx:externalCrossReference>, <tbx:note>, <tbx:pronunciation>, <tbx:see>, <tbx:source>, <tbx:term>, <tbx:usageNote>, <td>, <term>, <term-display>, <term-sec>, <th>
Description
Any combination of:
- Text, numbers, or special characters
- Accessibility Elements
- External Linking Elements
- Citation Elements
- Ownership Elements
- Emphasis Elements
- Inline Display Elements
- Other Inline Elements
- <fn> Footnote
- <target> Target of an Internal Link
- <tbx:entailedTerm> Entailed Term (TBX)
- <xref> X(cross) Reference
- Baseline Change Elements
Content Model
<!ELEMENT preformat %preformat-model; >
Expanded Content Model
(#PCDATA | alt-text | long-desc | email | ext-link | uri | citation-alternatives | element-citation | mixed-citation | std | attrib | permissions | bold | fixed-case | italic | monospace | num | overline | roman | sans-serif | sc | strike | underline | ruby | inline-graphic | private-char | inline-code | inline-media | abbrev | index-term | index-term-range-end | milestone-end | milestone-start | named-content | styled-content | fn | target | tbx:entailedTerm | xref | sub | sup)*
Tagged Sample
ASCII representation of a diagram
...
<fig id="fig1">
<caption>
<title>Security Gateway to Security Gateway Tunnel</title>
</caption>
<preformat><![CDATA[
+-+-+-+-+-+ +-+-+-+-+-+
| | IPsec | |
Protected |Tunnel | tunnel |Tunnel | Protected
Subnet <-->|Endpoint |<---------->|Endpoint |<--> Subnet
| | | |
+-+-+-+-+-+ +-+-+-+-+-+
]]></preformat>
</fig>
...