Knol will be unavailable during scheduled maintenance starting at Mon, 09 Nov 2009 18:30:00 GMT. We expect the maintenance to be completed at Mon, 09 Nov 2009 20:00:00 GMT.
Version: Baidi441

XML

The eXtensible Markup Language

The Extensible Markup Language (XML) is a general-purpose specification from the World Wide Web Consortium (W3C) for building domain-specific markup languages. Due to its extensibility, users can define their own set of elements. When viewed in a text editor, XML looks very similar to HTML.


Introduction

Throughout its ten years in existence, XML has revolutionized the way that organizations exchange and process data, it has provided the framework for many industry-specific standards, and it has been the vehicle of choice for shuttling data between a web browser and server in Web 2.0.

Purpose of XML

The purpose of XML is to facilitate the sharing and processing of structured documents and data across different information systems, between organizations, and across the Internet. XML is used to encode documents and to serialize data. It is designed to be both human-readable and machine-processable at the same time. 

History of XML

The following quote is taken from the original XML recommendation issued by the World Wide Web Consortium (W3C) on February 10, 1998:
"The Extensible Markup Language (XML) is a subset of SGML [...]. Its goal is to enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML has been designed for ease of implementation and for interoperability with both SGML and HTML."
XML has certainly come a long way since then. SGML has been reduced in importance and its use is now mostly restricted to large documentation systems - and even most of those are being transitioned to XML systems. HTML, which was originally based on SGML, has now been redefined on the basis of XML through the XHTML specification. XML also has gone through four editions and one point-release and there is now an entire series of supporting standards from the W3C and countless industry-specific markup languages built on XML.

XML Example

The following simple example shows the typical structure of an XML document:

<?xml version="1.0" encoding="UTF-8"?>
<faq author="Douglas Adams">
<question>What is the Answer to life, the universe, and everything?</question>
<answer provided-by="Deep Thought">42</answer>
</faq>

As you can see, an XML document consists of text (shown in black) surrounded by markup (shown in other colors). The familiar symbols < and > that we have all seen in HTML are used to bracket element names. Elements start with and opening tag (e.g. <question>) and end with a closing tag (e.g </question>). Between those tags is where the elements content resides, and this content can either be text, other elements, or both. Attributes of the form attribute="value" can be added to elements to provide additional meta information.
The XML specification allows for many different options, but the above example shows the most important features of an XML document that will help you read and understand XML in no time.

Specification

XML started as a simplified subset of the Standard Generalized Markup Language (SGML) and was defined by the World Wide Web Consortium (W3C) in 1998. There are currently two versions of the XML specification in existence:


XML 1.0 is the more widely used specification, and some argue that the changes in version 1.1 are mostly cosmetic and only relevant for some minor localization issues related to newer versions of the Unicode standard.

Working with XML

Even though XML is of paramount importance in today's software industry, it is rarely necessary for a software developer or information worker to resort to the actual specifications above, as XML is mostly read and written either through tools such as an XML Editor, or processed using XML parsers and/or processing engines that are part of every modern operating system or programming environment.

XML Editors

An XML Editor is a software application designed to make the creation and editing of XML documents easy and efficient. A typical XML Editor will understand document structure requirements in various languages (DTD, XML Schema) and will automatically enforce those requirements, ensuring that the user can only produce valid XML documents. In addition, the XML Editor will provide intelligent editing support that automatically suggest proper elements for insertion at any given position in the XML document. One of the most popular XML Editors today is Altova XMLSpy. For further information see the XML Editor article on Knol.

XML Parsers

A parser is a software module that is used by higher-level applications to process XML documents, extract their content, and validate the document structure with respect to an existing XML schema.

Related Specifications

There are several related specifications from the W3C that are designed to extend and augment XML, to facilitate better definition of XML structures, to process XML, and to transform and query XML data. Together, this set of specifications provides a powerful environment for working with XML in a standardized manner.

XML Schema

XML Schema is used to define the structure of an XML document and is designed to mostly replace the built-in DTD-mechanism of XML. For further information see the XML Schema article on Knol.


XSLT

XSLT stylesheets transform an XML document into another XML document, an HTML/XHTML Web page, or a simple text file. The XSLT stylesheet specifies how an XSLT processor should create the desired output from an associated XML input document. For further information, see the XSLT article on Knol.

Comments

Alexander Falk
Alexander Falk
CEO at Altova, Inc.
Marblehead, MA
Article rating:
Your rating:

Categories

Based on community consensus.

Activity for this knol

This week:

35pageviews

Totals:

964pageviews
1comments