Framify

Tag: <xmp>

<xmp> Syntax

Syntax Diagram for <xmp>
Opening Tag Content Closing Tag
<xmp> text </xmp>

<xmp> Description

The <xmp>. . . </xmp> tags declare the text that occurs between them to be a program example, and therefore, no line-wrapping should take place. The example text is also separated from the surrounding text by blank lines, to ease visual separation. Because the most common use of this is computer program listings, the text is also displayed in a typewriter font (whose monospacing allows alignment--of comments, for example--to appear).

Example text does not allow HTML tags to be interpreted, unlike <pre>, which does.

<xmp> Examples

This markup:
    Type in the following simple program:
    <xmp>
    for (I=1; I!=10; I++) {  # set up the loop
        print "I is $I\n";   # print current value
    }                        # end the loop
    <xmp>
    And then run it.


. . .causes the following to be displayed:

Type in the following simple program: for (I=1; I!=10; I++) { # set up the loop print "I is $I\n"; # print current value } # end the loop And then run it.
This example shows how HTML tags are not interpreted within an example block of text. This markup:
    <xmp>
    Here is some <b>bold</b> and
    some <i>italic</i> text.
    </xmp>
. . .causes the following to be displayed:
Here is some <b>bold</b> and some <i>italic</i> text.

Last Modified: