9. XHTML Inline Text Module

Contents

This section is normative.

This module defines all of the basic text container elements, attributes, and their content models that are "inline level". Note that while the concept of "inline level" can be construed as a presentation aspect, in this case it is intended to only have a semantic meaning.

Element Attributes Minimal Content Model
abbr Common (PCDATA | Inline)*
cite Common (PCDATA | Inline)*
code Common (PCDATA | Inline)*
dfn Common (PCDATA | Inline)*
em Common (PCDATA | Inline)*
kbd Common (PCDATA | Inline)*
l Common (PCDATA | Inline)*
quote Common (PCDATA | Inline)*
samp Common (PCDATA | Inline)*
span Common (PCDATA | Inline)*
strong Common (PCDATA | Inline)*
sub Common (PCDATA | Inline)*
sup Common (PCDATA | Inline)*
var Common (PCDATA | Inline)*

l element content model

Content model of the l element should not allow nested lines

The minimal content model for this module defines a content set:

Inline
abbr | cite | code | dfn | em | kbd | l | quote | samp | span | strong | var

Note that the use of the words Block and Inline here are meant to be suggestive of the role the content sets play. They are not normative with regards to presentation since a style sheet might give any element within the Block content a display property of inline.

Implementation: RELAX NG

nr element

There was a suggestion to introduce an nr element to help annotate content as being a number. This suggestion has not yet been addressed by the working group.

br element still needed

Several reviewers have commented that the l element is not really a replacement for the br element, and that both are needed. The working group is still discussing this issue.

9.1. The abbr element

The abbr element indicates that a text fragment is an abbreviation (e.g., W3C, XML, Inc., Ltd., Mass., etc.); this includes acronyms.

Attributes

The Common collection
A collection of other attribute collections, including: Core, Events, I18N, Bi-directional, Edit, Embedding, Map, and Hypertext

The content of the abbr element specifies the abbreviated expression itself, as it would normally appear in running text. The title attribute of these elements may be used to provide the full or expanded form of the expression.

Note that abbreviations often have idiosyncratic pronunciations. For example, while "IRS" and "BBC" are typically pronounced letter by letter, "NATO" and "UNESCO" are pronounced phonetically. Still other abbreviated forms (e.g., "URI" and "SQL") are spelled out by some people and pronounced as words by other people. When necessary, authors should use style sheets to specify the pronunciation of an abbreviated form.

Examples:

  <abbr title="Limited">Ltd.</abbr>
  <abbr title="Abbreviation">abbr.</abbr>

9.2. The cite element

The cite element contains a citation or a reference to other sources.

Attributes

The Common collection
A collection of other attribute collections, including: Core, Events, I18N, Bi-directional, Edit, Embedding, Map, and Hypertext

In the following example, the cite element is used to delineate the speaker:

As <cite cite="http://www.whitehouse.gov/history/presidents/ht33.html">Harry S. Truman</cite> said,
<quote xml:lang="en-us">The buck stops here.</quote>

More information can be found in <cite cite="http://www.w3.org/TR/REC-xml">[XML]</cite>.

9.3. The code element

The code element contains a fragment of computer code.

Attributes

The Common collection
A collection of other attribute collections, including: Core, Events, I18N, Bi-directional, Edit, Embedding, Map, and Hypertext

Example:

The Pascal statement <code>i := 1;</code> assigns the
literal value one to the variable <var>i</var>.

9.4. The dfn element

The dfn element contains the defining instance of the enclosed term.

Attributes

The Common collection
A collection of other attribute collections, including: Core, Events, I18N, Bi-directional, Edit, Embedding, Map, and Hypertext

Example:

An <dfn id="def-acronym">acronym</dfn> is a word formed
from the initial letters or groups of letters of words in a set phrase
or series of words.

9.5. The em element

The em element indicates emphasis for its contents.

Attributes

The Common collection
A collection of other attribute collections, including: Core, Events, I18N, Bi-directional, Edit, Embedding, Map, and Hypertext

Example:

Do <em>not</em> phone before 9 a.m.

9.6. The kbd element

The kbd element indicates text to be entered by the user.

Attributes

The Common collection
A collection of other attribute collections, including: Core, Events, I18N, Bi-directional, Edit, Embedding, Map, and Hypertext

Example:

To exit, type <kbd>QUIT</kbd>.

9.7. The l element

The l element represents a semantic line of text (e.g., a line of verse or a line of computer code). It is intended as a structured replacement for the br element.

When visually represented, the l element should start on a new line and have a line break at the end. Whether the line should wrap or not depends on styling properties of the element.

Attributes

The Common collection
A collection of other attribute collections, including: Core, Events, I18N, Bi-directional, Edit, Embedding, Map, and Hypertext

By retaining structure in text that has to be broken over lines, you retain essential information about its makeup. This gives you greater freedom with styling the content. For instance, line numbers can be generated automatically from the stylesheet if needed.

For instance, for a document with the following structure:

<p class="program">
<l>program p(input, output);</l>
<l>begin</l>
<l>   writeln("Hello world");</l>
<l>end.</l>
</p>

the following CSS stylesheet would number each line:

.program { counter-reset: linenumber }

l:before {
    position: relative;
    left: -1em;
    counter-increment: linenumber;
    content: counter(linenumber);
}

9.8. The quote element

This element designates an inline text fragment of quoted text.

Attributes

The Common collection
A collection of other attribute collections, including: Core, Events, I18N, Bi-directional, Edit, Embedding, Map, and Hypertext

Visual user agents must not by default add delimiting quotation marks (as was the case for the q element in earlier versions of XHTML). It is the responsibility of the document author to add any required quotation marks, either directly in the text, or via a stylesheet.

The following example illustrates nested quotations with the quote element.

<p>John said, <quote>"I saw Lucy at lunch, she told me
<quote>'Mary wants you
to get some ice cream on your way home.'</quote> I think I will get
some at Jen and Berry's, on Gloucester Road."</quote></p>

Here is an example using the cite attribute:

Steven replied:
<quote cite="http://lists.example.org/2002/01.html">We quite agree</quote>

9.9. The samp element

The samp element designates sample output from programs, scripts, etc.

Attributes

The Common collection
A collection of other attribute collections, including: Core, Events, I18N, Bi-directional, Edit, Embedding, Map, and Hypertext

Example:

On starting, you will see the prompt <samp>$ </samp>.

9.10. The span element

The span element, in conjunction with the id and class attributes, offer a generic mechanism for adding structure to documents. This element imposes no presentational idioms on the content. Thus, authors may use this element in conjunction with style sheets, the xml:lang attribute, etc., to tailor XHTML to their own needs and tastes.

Attributes

The Common collection
A collection of other attribute collections, including: Core, Events, I18N, Bi-directional, Edit, Embedding, Map, and Hypertext

For example, suppose you wish to mark all words in a document that need to be collected into an index. You could use a span element, with a class of xref:

<p>This operation is called
the <span class="xref">transpose</span>
or <span class="xref">inverse</span>.</p>

9.11. The strong element

The strong element indicates higher importance for its contents.

Attributes

The Common collection
A collection of other attribute collections, including: Core, Events, I18N, Bi-directional, Edit, Embedding, Map, and Hypertext
On <strong>Monday</strong> please put the rubbish out,
but <em>not</em> before nightfall!

strong

Leave in, deprecate or remove? No consensus.

9.12. The sub element

The sub element indicates that its contents should regarded as a subscript.

Attributes

The Common collection
A collection of other attribute collections, including: Core, Events, I18N, Bi-directional, Edit, Embedding, Map, and Hypertext

For visual user agents this element would normally be rendered as a subscript of the text baseline, but on user agents where this is not possible (for instance teletype-like devices) other renderings may be used. For instance, a<sub>i, j</sub> that would be rendered as ai, j on a device that can render it so, might be rendered as a[i, j] on a simpler device.

Example:

      H<sub>2</sub>O

9.13. The sup element

The sup element indicates that its contents should be regarded as a super-script.

Attributes

The Common collection
A collection of other attribute collections, including: Core, Events, I18N, Bi-directional, Edit, Embedding, Map, and Hypertext

For visual user agents this element would normally be rendered as a super-script of the text baseline, but on user agents where this is not possible (for instance teletype-like devices) other renderings may be used. For instance, 2<sup>n</sup> that would be rendered as 2n on a device that can render it so, might be rendered as 2↑(n) on a simpler device.

Many scripts (e.g., French) require superscripts or subscripts for proper rendering. The sub and sup elements should be used to markup text in these cases.

      H<sub>2</sub>O
      E = mc<sup>2</sup>
      <span xml:lang="fr">M<sup>lle</sup> Dupont</span>

9.14. The var element

The var element indicates an instance of a variable or program argument.

Attributes

The Common collection
A collection of other attribute collections, including: Core, Events, I18N, Bi-directional, Edit, Embedding, Map, and Hypertext

Example:

The parameter <var>ncols</var> represents
the number of colors to use.