About XML

Page Index

What is XML?

XML stands for Extensible Markup Language. It is a markup language much like HTML that uses embedded tags. However, where HTML uses tags to display information, XML uses tags to describe information. XML was designed to describe data, not display it. In other words, XML tags describe content, while HTML tags describe format. XML does not DO anything; it was created to hold and structure information. XML is a human readable archival format that, with the use of XSL stylesheets, can be converted to presentation format. It provides a portable storage method for IGTs, lexicons and metadata.

More on stylesheets

How to write XML

XML tags are not predefined like HTML tags. It is therefore possible to use user-defined tags as a way of encoding the structure of information in a plain text format. When these tags are used with a logical nesting structure and appropriate namespaces, data can be arranged in a transparent and interoperable format.

Here is an example of a small XML document ("cat.xml"). Note that the document references a namespace to give the tags a logical context.

<?xml version="1.0" encoding="UTF-8"?>
<lexicon xmlns:xsi="http://emeld.org/my-namespace">
<metadataFile href="xyz.xml"/>
  <form formtype="free root" id="2860" lang="Biao Min">
    <grammatical-relation relation-term="is a" pos="Noun"/>
    <gloss lang="English" value="cat"></gloss>

This file is composed of sets of user-defined XML tags that are embedded within each other.

More on how to write XML

Alternatives to writing XML

XML is the most highly recommended format for data storage. However, it is possible to create an XML version of your data without actually writing XML. Data stored in, for instance, an excel spreadsheet can be exported as an XML document. Furthermore, it is important to note that data in any format is better than no data at all. While XML is best practice, XML compatible formats are good practice, and any format is better than not recording the data at all.

More on alternatives to writing XML

XML validation

In order to support interoperability and maximize intelligibility, it is optimal to define tags in a way that validates with an XML schema or DTD. If this is not possible, it is important to at least be consistent in your use of tags, and to provide a key that explains what each tag means.

More on XML validation

User Contributed Notes
About XML
+ Add a comment
  + View comments

Back to top Credits | Glossary | Help | Navigation | Site Map | Site Search