This tutorial covers the basic ideas and methodologies behind XML. It will attempt to teach you, the reader, how to get started using the language. In this first part we will uncover the history of XML and learn its basic syntax, as well as its advantages and disadvantages, in the hopes of learning if it is right for you.
What is XML?
XML stands for Extensible Markup Language and is a specification for users who wish to create their own markup language(s). A markup language is an artificial type of language that uses a set of annotated text describing how content should be laid out on a page, how it should be structured, and how to format it. Forms of markup languages include HTML, XHTML, and so forth.
XML is a subset of, and born of, SGML, or Standard Generalized Markup Language, which also helped give birth to HTML. A group of eleven people, known as the XML Working Group, helped to create it, though they never met face to face. Instead they worked via teleconferences and email, creating the first specification of the "language" in twenty weeks. The first working draft was published in November of 1996 and XML 1.0 received the thumbs up from the W3C on February 10, 1998.
There are two versions of XML. They are XML 1.0 and XML 1.1. The main difference between the two is that XML 1.1 supports more Unicode characters and allows the use of more control characters, such as dual line break codes.
There is also a discussion of XML 2.0, though at the time of this writing, the issue is still in debate.
The Advantages of Using XML
There are many advantages to using XML, and while some of those listed below are opinions, they are based on feedback from ten years of use and are common to many critiques:
It allows us to communicate information in any written language via its support of Unicode.
It represents data structures, such as lists, records, and trees.
It offers a way to self-document structure, field names, and data, giving us the opportunity to describe the data.
It allows for simple, straightforward parsing methods, thanks in part to its tight syntax.
The language is text-based and is based off of international standards.
It is perfect for document storage and can be used online and offline as well.
It is perfect for document processing, which can also be done offline and online. An example would be using it in Microsoft Office as well on a website.
It supports a hierarchical structure, allowing for parent/child relationships.
It relies on no one platform, meaning you can use it regardless of operating system.
It can be validated via scheming languages.
It is forward and backward compatible.
It is based off of a reliable language, SGML, which has been in use since 1986.