Web Markup Languages

Markup languages (ML) were originally designed for text processing and presentation such as formatting, size, and location. If you have the recipe for your favorite cake, you can use that recipe and the proper ingredients to make that cake. Markup languages are like recipes used for defining, presenting, and processing text.

HTML

Hypertext Markup Language (HTML) is the standard markup language used to create web pages. HTML is written using tag or predefined keywords, which are enclosed in angle brackets (e.g., <body>, <title>, <p>). See the example of HTML code.

EXAMPLE BASIC HTML STRUCTURE

<html>
<head></head>
<body>
     <form method="post" action="http://localhost:8080/demo/echo">
          Enter your name:<input type="text" name="user"/><br/><br/>
          <input type="submit" value="Submit"/>
          <input type="reset" value="Reset"/>
     </form>
<a href="http://www.google.com">Google</a>
</body>
</html>

XML

Extensible Markup Language (XML) is used mainly for business data specification and integration where there are different types of business data and data structures. For processing, data types should be represented in defined formats (Tao, 2008). Unlike HTML, which has predefined terms, XML does not limit what tag or attribute names can be used. Here is an example of XML code.

EXAMPLE XML STRUCTURE

<library> 
<dvd id="1"> 
    <title>Star Wars</title> 
    <format>Movie</format> 
    <genre>Science Fiction</genre> 
</dvd> 
</library> 

XHTML

The Extensible Hypertext Markup Language (XHTML) is in the XML family. It was developed to make HTML more extensible and increase interoperability with other data formats to better support flexible data presentation on different devices. The goal of shifting to XML format was for HTML to become compatible with common XML tools. See below for an example of XHTML code.

EXAMPLE XHTML STRUCTURE

<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD/xhtml1-strict.dtd">
<html xmins="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 
<head>
<title>Virtual Library</title> 
</head> 
<body> 
<p>Moved to <a href="http://example.org/">example.org</a>.</p> 
</body> 
</html> 

CSS

A cascading style sheet (CSS) is used to maintain a consistent look across various browsers, since each browser has its own method of publishing HTML elements and web pages without style sheets can look different in different browsers. For example, regular HTML standards do not specify a certain font size for a top-level h1 heading (Tao, 2008).

An example CSS rule, h1 {color: blue, font-size: 12px}, is applied to an .html file and then shown on a website.

So a style sheet that consists of a list of style rules can specify size headings. See the figure below for an example of a CSS rule.

References

Tao, L. (2008). A tutorial on XHTML and XML. http://csis.pace.edu/~lchen/sweet/tutorials/htmlXmlTutorial.pdf

Check Your Knowledge

For the following questions, select true or false for these definitions.
Question 1
CSS is a style sheet language used for describing the look and formatting of a document written in a markup language.
True
False
Question 2
HTML is a computer language used to create documents stored in a database server.
True
False
Question 3
XML is a markup language that defines a set of rules for encoding documents in a format that is both human-readable and machine-readable.
True
False
Question 4
XHTML is an XML-family markup language that increases interoperability with other data formats to better support flexible data presentation on different devices.
True
False