Markup language: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
m Automated conversion
If you're going to use the entity codes, don't use <pre>
Line 3: Line 3:
The most common markup languages in use today are [[SGML]] and its derivatives, such as [[HTML]] and [[DocBook]]. These languages intermix the text of a document with markup instructions in the same data stream or file. Here, for example, is a small section of text marked up in HTML:
The most common markup languages in use today are [[SGML]] and its derivatives, such as [[HTML]] and [[DocBook]]. These languages intermix the text of a document with markup instructions in the same data stream or file. Here, for example, is a small section of text marked up in HTML:


:&lt;h1&gt; Anatidae &lt;/h1&gt;
<pre>
&lt;h1&gt; Anatidae &lt;/h1&gt;
:&lt;p&gt; The family &lt;i&gt;Anatidae&lt;/i&gt; includes ducks, geese, and swans,
:but &lt;em&gt;not&lt;/em&gt; the closely-related screamers.
&lt;p&gt; The family &lt;i&gt;Anatidae&lt;/i&gt; includes ducks, geese, and swans,
but &lt;em&gt;not&lt;/em&gt; the closely-related screamers.
</pre>


The codes enclosed in angle-brackets &lt;like this&gt; are markup instructions, while the text between these instructions is the actual text of the document. The codes "h1" and "em" are examples of <i>structural</i> markup, in that they describe the intended purpose or meaning of the text they include (specifically, "h1" means "this is a first-level heading" and "em" means "this is an emphasized word"). A device reading such structural markup may apply its own rules or styles for presenting it, using larger type, boldface, indentation, or whatever style it prefers. The "i" instruction is an example of <i>presentational</i> markup. It specifies the exact appearance of the text (in this case, the use of an italic typeface) without specifying its purpose.
The codes enclosed in angle-brackets &lt;like this&gt; are markup instructions, while the text between these instructions is the actual text of the document. The codes "h1" and "em" are examples of <i>structural</i> markup, in that they describe the intended purpose or meaning of the text they include (specifically, "h1" means "this is a first-level heading" and "em" means "this is an emphasized word"). A device reading such structural markup may apply its own rules or styles for presenting it, using larger type, boldface, indentation, or whatever style it prefers. The "i" instruction is an example of <i>presentational</i> markup. It specifies the exact appearance of the text (in this case, the use of an italic typeface) without specifying its purpose.

Revision as of 23:16, 13 February 2002

A markup language is a kind of text encoding that represents text as well as details about the structure and appearance of the text. The name is derived from the traditional publishing practice of "marking up" a manuscript, that is, adding printer's instructions in the margins of a paper manuscript. Markup languages are used, for example, by the publishing industry to communicate printed works among authors, editors, and printers.

The most common markup languages in use today are SGML and its derivatives, such as HTML and DocBook. These languages intermix the text of a document with markup instructions in the same data stream or file. Here, for example, is a small section of text marked up in HTML:

<h1> Anatidae </h1>
<p> The family <i>Anatidae</i> includes ducks, geese, and swans,
but <em>not</em> the closely-related screamers.

The codes enclosed in angle-brackets <like this> are markup instructions, while the text between these instructions is the actual text of the document. The codes "h1" and "em" are examples of structural markup, in that they describe the intended purpose or meaning of the text they include (specifically, "h1" means "this is a first-level heading" and "em" means "this is an emphasized word"). A device reading such structural markup may apply its own rules or styles for presenting it, using larger type, boldface, indentation, or whatever style it prefers. The "i" instruction is an example of presentational markup. It specifies the exact appearance of the text (in this case, the use of an italic typeface) without specifying its purpose.

See also: HTML, SMIL, XML