18.1.1- The Characteristics of Markup Languages
by NT Community Manager.
|
| << 18.1.0- What is a Markup Language? | Chapter18 | 18.1.2- Examples of Markup Languages >> |
The Characteristics of Markup Languages
It is possible to classify markup as one of four types:
- Stylistic Markup. This indicates how the document is to be presented. When we use bolding or italics on a word processor it is stylistic markup. In HTML the <FONT>, <I>, <B>, and <U> tags are all stylistic markup.
- Structural Markup. This informs us how the document should be structured. The <Hn> (where n is a number), <P> and the <DIV> tags are examples of structural markup, which indicate a heading, paragraph and container section respectively.
- Semantic Markup. This tells us something about the content of the data, as such <TITLE> and <CODE> are examples of semantic markup in HTML.
- Functional Markup. This adds functionality to the data that is marked up, such as hyper links and pointers, sound files etc.
Markup languages define the markup rules that add meaning to the style, structure, and content of documents. They are the grammar and the syntax which specify how a language should be 'spoken'. A familiar example is HTML – which is a markup language that enables you to write a document for display on the Web.
Tags and Elements
Even those of us who are familiar with HTML still often get the meaning of tags and elements mixed up. Just to clarify, tags are the angled brackets (known as delimiters), and the text between them. Here are some examples of tags used in HTML:
<P> is a tag that marks the beginning of a new paragraph
<I> is a tag indicating that the following text should be rendered in italic type
</I> is a tag that indicates the end of a section of text to be rendered in italic type
Elements, however, refer to the tags plus their content. So the following is an example of an element:
<B>Here is some bold text</B>
In general terms, a tag is a label that tells a user-agent (such as a browser) to do something to whatever is encased in the tags.
A user-agent is anything that acts on your behalf. You are a user agent working for your boss, your computer is a user agent working for you, your browser is a user agent working for you and your computer, and so it goes on.
Empty elements which don't have closing tags, such as the <IMG> element in HTML, have to be treated differently in XML to make up for them not having a closing tag – but don't worry about that for now, we will come back to them later.
The following diagram illustrates the parts of an element:
Attributes
Any tag can have an attribute as long as it is defined. They take the form of name/value pairs (also referred to as attribute/value pairs), in that the element can be given an attribute (with a name), and the attribute must carry a text value surrounded by quotation marks. They take the form:
<tagname attribute="value">
For example, in HTML 4.0 the <BODY> tag can take the following attributes:
CLASS ID DIR LANG STYLE TITLE
BACKGROUND BGCOLOR ALINK LINK VLINK TEXT.
So, for example, in HTML BODY could take the following attributes:
<BODY BGCOLOR="#000000" ALINK="#999999" LINK="#990099" VLINK="#888888" TEXT="#999999">
| << 18.1.0- What is a Markup Language? | Chapter18 | 18.1.2- Examples of Markup Languages >> |

RSS

