|Lesson 3|| Define Metalanguages |
|Objective||Describe what a metalanguage is. |
Define XML Metalanguages
- SGML is a superset of XML and HTML. SGML is a complex metalanguage .
- XML is a subset of SGML. XML is a metalanguage but it is not as complex to work with as SGML. XML may be used to define other markup languages.
- HTML is a markup language that was defined using SGML.
Defining a markup language
Using XML, you can define a set of elements that may be used to describe a customer, a purchase order, a mathematical formula,
a chemical compound, or any other physical or logical entity of interest. The set of elements you define may then be used to describe many specific instances of that entity.
For example, you can describe a purchase order using the following set of XML elements:
Notice that XML does not use a fixed, predefined set of elements as HTML did.
Each purchase order defined in the XML document is an XML document instance and is described using this set of elements.
In this example, the same set of elements may also be used to describe purchase orders 1006, 1007, and so on. For each purchase order described with these XML elements, the values included in the elements may change.
Since XML is used to define markup languages, once you have defined a markup language, you may use a markup language to define rules for creating XML documents. These rules are specified using a Document Type Definition, or DTD.
The DTD is used to validate XML document instances that use the markup language you have defined. DTDs will be discussed in detail later in the course.
In the next lesson, you will examine some of the limitations of HTML.