- Great Painters
- Accounting
- Fundamentals of Law
- Marketing
- Shorthand
- Concept Cars
- Videogames
- The World of Sports

- Blogs
- Free Software
- Google
- My Computer

- PHP Language and Applications
- Wikipedia
- Windows Vista

- Education
- Masterpieces of English Literature
- American English

- English Dictionaries
- The English Language

- Medical Emergencies
- The Theory of Memory
- The Beatles
- Dances
- Microphones
- Musical Notation
- Music Instruments
- Batteries
- Nanotechnology
- Cosmetics
- Diets
- Vegetarianism and Veganism
- Christmas Traditions
- Animals

- Fruits And Vegetables


  1. Adobe Reader
  2. Adware
  3. Altavista
  4. AOL
  5. Apple Macintosh
  6. Application software
  7. Arrow key
  8. Artificial Intelligence
  9. ASCII
  10. Assembly language
  11. Automatic translation
  12. Avatar
  13. Babylon
  14. Bandwidth
  15. Bit
  16. BitTorrent
  17. Black hat
  18. Blog
  19. Bluetooth
  20. Bulletin board system
  21. Byte
  22. Cache memory
  23. Celeron
  24. Central processing unit
  25. Chat room
  26. Client
  27. Command line interface
  28. Compiler
  29. Computer
  30. Computer bus
  31. Computer card
  32. Computer display
  33. Computer file
  34. Computer games
  35. Computer graphics
  36. Computer hardware
  37. Computer keyboard
  38. Computer networking
  39. Computer printer
  40. Computer program
  41. Computer programmer
  42. Computer science
  43. Computer security
  44. Computer software
  45. Computer storage
  46. Computer system
  47. Computer terminal
  48. Computer virus
  49. Computing
  50. Conference call
  51. Context menu
  52. Creative commons
  53. Creative Commons License
  54. Creative Technology
  55. Cursor
  56. Data
  57. Database
  58. Data storage device
  59. Debuggers
  60. Demo
  61. Desktop computer
  62. Digital divide
  63. Discussion groups
  64. DNS server
  65. Domain name
  66. DOS
  67. Download
  68. Download manager
  69. DVD-ROM
  70. DVD-RW
  71. E-mail
  72. E-mail spam
  73. File Transfer Protocol
  74. Firewall
  75. Firmware
  76. Flash memory
  77. Floppy disk drive
  78. GNU
  79. GNU General Public License
  80. GNU Project
  81. Google
  82. Google AdWords
  83. Google bomb
  84. Graphics
  85. Graphics card
  86. Hacker
  87. Hacker culture
  88. Hard disk
  89. High-level programming language
  90. Home computer
  91. HTML
  92. Hyperlink
  93. IBM
  94. Image processing
  95. Image scanner
  96. Instant messaging
  97. Instruction
  98. Intel
  99. Intel Core 2
  100. Interface
  101. Internet
  102. Internet bot
  103. Internet Explorer
  104. Internet protocols
  105. Internet service provider
  106. Interoperability
  107. IP addresses
  108. IPod
  109. Joystick
  110. JPEG
  111. Keyword
  112. Laptop computer
  113. Linux
  114. Linux kernel
  115. Liquid crystal display
  116. List of file formats
  117. List of Google products
  118. Local area network
  119. Logitech
  120. Machine language
  121. Mac OS X
  122. Macromedia Flash
  123. Mainframe computer
  124. Malware
  125. Media center
  126. Media player
  127. Megabyte
  128. Microsoft
  129. Microsoft Windows
  130. Microsoft Word
  131. Mirror site
  132. Modem
  133. Motherboard
  134. Mouse
  135. Mouse pad
  136. Mozilla Firefox
  137. Mp3
  138. MPEG
  139. MPEG-4
  140. Multimedia
  141. Musical Instrument Digital Interface
  142. Netscape
  143. Network card
  144. News ticker
  145. Office suite
  146. Online auction
  147. Online chat
  148. Open Directory Project
  149. Open source
  150. Open source software
  151. Opera
  152. Operating system
  153. Optical character recognition
  154. Optical disc
  155. output
  156. PageRank
  157. Password
  158. Pay-per-click
  159. PC speaker
  160. Peer-to-peer
  161. Pentium
  162. Peripheral
  163. Personal computer
  164. Personal digital assistant
  165. Phishing
  166. Pirated software
  167. Podcasting
  168. Pointing device
  169. POP3
  170. Programming language
  171. QuickTime
  172. Random access memory
  173. Routers
  174. Safari
  175. Scalability
  176. Scrollbar
  177. Scrolling
  178. Scroll wheel
  179. Search engine
  180. Security cracking
  181. Server
  182. Simple Mail Transfer Protocol
  183. Skype
  184. Social software
  185. Software bug
  186. Software cracker
  187. Software library
  188. Software utility
  189. Solaris Operating Environment
  190. Sound Blaster
  191. Soundcard
  192. Spam
  193. Spamdexing
  194. Spam in blogs
  195. Speech recognition
  196. Spoofing attack
  197. Spreadsheet
  198. Spyware
  199. Streaming media
  200. Supercomputer
  201. Tablet computer
  202. Telecommunications
  203. Text messaging
  204. Trackball
  205. Trojan horse
  206. TV card
  207. Unicode
  208. Uniform Resource Identifier
  209. Unix
  210. URL redirection
  211. USB flash drive
  212. USB port
  213. User interface
  214. Vlog
  215. Voice over IP
  216. Warez
  217. Wearable computer
  218. Web application
  219. Web banner
  220. Web browser
  221. Web crawler
  222. Web directories
  223. Web indexing
  224. Webmail
  225. Web page
  226. Website
  227. Wiki
  228. Wikipedia
  229. WIMP
  230. Windows CE
  231. Windows key
  232. Windows Media Player
  233. Windows Vista
  234. Word processor
  235. World Wide Web
  236. Worm
  237. XML
  238. X Window System
  239. Yahoo
  240. Zombie computer

This article is from:

All text is available under the terms of the GNU Free Documentation License: 

Extensible Markup Language

From Wikipedia, the free encyclopedia

(Redirected from XML)

The Extensible Markup Language (XML) is a W3C-recommended general-purpose markup language that supports a wide variety of applications. XML languages or 'dialects' are easy to design and to process. XML is also designed to be reasonably human-legible, and to this end, terseness was not considered essential in its structure. XML is a simplified subset of Standard Generalized Markup Language (SGML). Its primary purpose is to facilitate the sharing of data across different information systems, particularly systems connected via the Internet[1]. Formally defined languages based on XML (such as RSS, MathML, XHTML, Scalable Vector Graphics, MusicXML and thousands of other examples) allow diverse software reliably to understand information formatted and passed in these languages.


The versatility of SGML for dynamic information display was understood by early digital media publishers in the late 1980s prior to the rise of the Internet.[2] [3] By the mid-1990s some practitioners of SGML had gained experience with the then-new World Wide Web, and believed that SGML offered solutions to some of the problems the Web was likely to face as it grew. Dan Connolly added SGML to the list of W3C's activities when he joined the staff in 1995; work began in mid-1996 when Jon Bosak developed a charter and recruited collaborators. Bosak was well connected in the small community of people who had experience both in SGML and the Web. He received support in his efforts from Microsoft.

XML was designed by a working group of eleven members,[4] supported by an (approximately) 150-member Interest Group. Technical debate took place on the Interest Group mailing list and issues were resolved by consensus or, when that failed, majority vote of the Working Group. The decision record was compiled by Michael Sperberg-McQueen 4 December 1997. James Clark served as Technical Lead of the Working Group, notably contributing the empty-element "<empty/>" syntax and the name "XML". Other names that had been put forward for consideration included "MAGMA" (Minimal Architecture for Generalized Markup Applications), "SLIM" (Structured Language for Internet Markup) and "MGML" (Minimal Generalized Markup Language). The co-editors of the specification were originally Tim Bray and Michael Sperberg-McQueen. Halfway through the project Bray accepted a consulting engagement with Netscape, provoking vociferous protests from Microsoft. Bray was temporarily asked to resign the editorship. This led to intense dispute in the Working Group, eventually solved by the appointment of Microsoft's Jean Paoli as a third co-editor.

The XML Working Group never met face-to-face; the design was accomplished using a combination of email and weekly teleconferences. The major design decisions were reached in twenty weeks of intense work between July and November of 1996. Further design work continued through 1997, and XML 1.0 became a W3C Recommendation on February 10, 1998 .

XML 1.0 achieved the Working Group's goals of Internet usability, general-purpose usability, SGML compatibility, facilitation of easy development of processing software, minimization of optional features, legibility, formality, conciseness, and ease of authoring.

Clarifications and minor changes were accumulated in published errata and then incorporated into a Second Edition of the XML 1.0 Recommendation on October 6, 2000. Subsequent errata were incorporated into a Third Edition on February 4, 2004.

Also published on the same day as XML 1.0 Third Edition was XML 1.1, a variant of XML that encourages more consistency in how characters are represented and relaxes restrictions on names, allowable characters, and end-of-line representations.

On August 16, 2006, XML 1.0 Fourth Edition and XML 1.1 Second edition were published to incorporate the accumulated errata.

Both XML 1.0 Fourth Edition and XML 1.1 Second Edition are considered current versions of XML.

Features of XML

XML provides a text-based means to describe and apply a tree-based structure to information. At its base level, all information manifests as text, interspersed with markup that indicates the information's separation into a hierarchy of character data, container-like elements, and attributes of those elements. In this respect, it is similar to the LISP programming language's S-expressions, which describe tree structures wherein each node may have its own property list.

The fundamental unit in XML is the character, as defined by the Universal Character Set. Characters are combined to form an XML document. The document consists of one or more entities, each of which is typically some portion of the document's characters, stored in a text file.

XML files may be served with a variety of Media types. RFC3023 defines the types "application/xml" and "text/xml", which say only that the data is in XML, and nothing about its semantics. The use of "text/xml" has been criticized as a potential source of encoding problems but is now in the process of being deprecated[5]. RFC3023 also recommends that XML-based languages be given media types beginning in "application/" and ending in "+xml"; for example "application/atom+xml" for Atom. This page discusses further XML and MIME.

The ubiquity of text file authoring software (basic text editors such as Notepad and TextEdit as well as word processors) facilitates rapid XML document authoring and maintenance. Prior to the advent of XML, there were very few data description languages that were general-purpose, Internet protocol-friendly, and very easy to learn and author. In fact, most data interchange formats were proprietary, special-purpose, "binary" formats (based foremost on bit sequences rather than characters) that could not be easily shared by different software applications or across different computing platforms, much less authored and maintained in common text editors.

By leaving the names, allowable hierarchy, and meanings of the elements and attributes open and definable by a customizable schema, XML provides a syntactic foundation for the creation of custom, XML-based markup languages. The general syntax of such languages is rigid — documents must adhere to the general rules of XML, assuring that all XML-aware software can at least read (parse) and understand the relative arrangement of information within them. The schema merely supplements the syntax rules with a set of constraints. Schemas typically restrict element and attribute names and their allowable containment hierarchies, such as only allowing an element named 'birthday' to contain 1 element named 'month' and 1 element named 'day', each of which has to contain only character data. The constraints in a schema may also include data type assignments that affect how information is processed; for example, the 'month' element's character data may be defined as being a month according to a particular schema language's conventions, perhaps meaning that it must not only be formatted a certain way, but also must not be processed as if it were some other type of data.

In this way, XML contrasts with HTML, which has an inflexible, single-purpose vocabulary of elements and attributes that, in general, cannot be repurposed. With XML, it is much easier to write software that accesses the document's information, since the data structures are expressed in a formal, relatively simple way.

XML makes no prohibitions on how it is used. Although XML is fundamentally text-based, software quickly emerged to abstract it into other, richer formats, largely through the use of datatype-oriented schemas and object-oriented programming paradigms (in which the document is manipulated as an object). Such software might treat XML as serialized text only when it needs to transmit data over a network, and some software doesn't even do that much. Such uses have led to "binary XML", the relaxed restrictions of XML 1.1, and other proposals that run counter to XML's original spirit and thus garner an amount of criticism.

Strengths and weaknesses

Strengths of XML

Some features of XML that make it well-suited for data transfer are:

  • It is simultaneously human and machine-readable format;
  • It supports Unicode, allowing almost any information in any written human language to be communicated;
  • It can represent the most general computer science data structures: records, lists and trees;
  • Its self-documenting format describes structure and field names as well as specific values;
  • The strict syntax and parsing requirements make the necessary parsing algorithms extremely simple, efficient, and consistent.

XML is also heavily used as a format for document storage and processing, both online and offline, and offers several benefits:

  • Its robust, logically-verifiable format is based on international standards;
  • The hierarchical structure is suitable for most (but not all) types of documents;
  • It manifests as plain text files, unencumbered by licenses or restrictions;
  • It is platform-independent, thus relatively immune to changes in technology;
  • Its predecessor, SGML, has been in use since 1986, so there is extensive experience and software available.

Weaknesses of XML

For certain applications, XML also has the following weaknesses:

  • Its syntax is verbose and redundant. This was intentional and contributes to ease of parsing and error detection, but also poses some problems. Intensively marked-up documents can become so cluttered as to be unreadable; however, "unreadable" means "unreadable in a plain text editor". The alternative is binary formats, which are even less readable without specialized tools, so this criticism is misleading. A more real problem is that the redundancy may affect application efficiency through higher storage and transmission costs, even though compression is commonly very effective for XML data (precisely because its redundancy leads to low entropy.[5] This is particularly true for multimedia applications running on cell phones and PDAs which want to use XML to describe images and video.
  • Generic XML parsers must be able to recurse arbitrarily nested data structures and may perform additional checks to detect improperly formatted or differently ordered syntax or data (this is because the markup is descriptive and partially redundant, as noted above). This amounts to overhead for very basic uses of XML, which may be significant where resources are scarce - for example in embedded systems. Furthermore, additional security considerations arise when XML input is fed from untrustworthy sources and resource exhaustion or stack overflows are possible.
  • Some consider the syntax to contain a number of obscure, unnecessary features born of its legacy of SGML compatibility. However, an effort to settle on a subset called "Minimal XML" led to the discovery that there was no consensus on which features were in fact obscure or unnecessary.
  • The basic parsing requirements do not directly support data types; XML provides no specific notion of "integer", "date", and there is no provision for mandating that, for example, "3.14159" be a floating-point number rather than a seven-character string. Such conversions require processing. Again this is intentional: expressing the quantity ten as the string "10" completely avoids problems such as the integer storage formats of various computers (see endianness), which also require conversions when data moves between machines. Thus, this can be an advantage or disadvantage depending on the application. Most XML schema languages[6] add datatype functionality.
  • Some consider the hierarchical model for representation limited compared to the relational model, since it only gives a fixed view of the actual information: either actors under movies, for example, or movies under actors. Others consider it more powerful because it can directly represent recursive and iterative structures without resorting to serial number fields, recursive join operations, and sorting; which model holds the practical advantage depends on the data and operations required. Note that XML naturally expresses the hierarchical syntax of the SQL query language which is used to serialize relational databases as one method of database backup, so this objection does not apply to the use of XML to serialize relational data, but pertains to the use of XML to express data relations directly.
  • Mapping XML to the relational or object oriented paradigms is often cumbersome, although the reverse is typically easy. Some take this as evidence that XML's model is indeed the more powerful, though the issue has been hotly debated since the late 1980's.
  • Expressing overlapping (non-hierarchical) data structures requires extra effort. Such techniques are a current research topic among researchers interested in XML.[7]
  • Some have argued that XML can be used for data storage only if the file is of low volume, but this is only true given particular assumptions about architecture, data, implementation, and other issues. Even very large SGML and XML structures can be accessed very rapidly.[8]
See also: "XML Sucks" on, Daring to Do Less with XML

Quick syntax tour

The basic syntax for one element in XML is

 <name attribute="value">content</name>

Here is an example of a simple recipe expressed using XML:

<?xml version="1.0" encoding="UTF-8"?><recipe name="bread" prep_time="5 mins" cook_time="3 hours">  <title>Basic bread</title>  <ingredient amount="3" unit="cups">Flour</ingredient>  <ingredient amount="0.25" unit="ounce">Yeast</ingredient>  <ingredient amount="1.5" unit="cups" state="warm">Water</ingredient>  <ingredient amount="1" unit="teaspoon">Salt</ingredient>  <instructions>    <step>Mix all ingredients together, and knead thoroughly.</step>    <step>Cover with a cloth, and leave for one hour in warm room.</step>    <step>Knead again, place in a tin, and then bake in the oven.</step>  </instructions></recipe>

The first line is the XML declaration: it is an optional line stating what version of XML is in use (normally version 1.0), and may also contain information about character encoding and external dependencies.

The remainder of this document consists of nested elements, some of which have attributes and content. An element typically consists of two tags, a start tag and an end tag, possibly surrounding text and other elements. The start tag consists of a name surrounded by angle brackets, like "<step>"; the end tag consists of the same name surrounded by angle brackets, but with a slash preceding the name, like "</step>". The element's content is everything that appears between the start tag and the end tag, including text and other (child) elements. The following is a complete XML element, with start tag, text content, and end tag:

<step>Knead again, place in a tin, and then bake in the oven.</step>

In addition to text content, an element can contain attributes — name-value pairs included in the start tag after the element name. Attribute values must always be quoted, using single or double quotes, and each attribute name should appear only once in any element.

<ingredient amount="3" unit="cups">Flour</ingredient>

In this example, the ingredient element has two attributes: amount, having value "3", and unit, having value "cups". In both cases, at the markup level, the names and values of the attributes, just like the names and content of the elements, are just textual data — the "3" and "cups" are not a quantity and unit of measure, respectively, but rather are just character sequences that the document author may be using to represent those things.

Elements may contain other elements:

<instructions> <step>Mix all ingredients together, and knead thoroughly.</step> <step>Cover with a cloth, and leave for one hour in warm room.</step> <step>Knead again, place in a tin, and then bake in the oven.</step></instructions>

In this case, the instructions element contains three step elements. XML requires that elements be properly nested — elements may never overlap. For example, this is not well-formed XML, because the em and strong elements overlap:

<!-- WRONG! NOT WELL-FORMED XML! --><p>Normal <em>emphasized <strong>strong emphasized</em> strong</strong></p>

Every XML document must have exactly one top-level root element (alternatively called a document element), so the following would also be a malformed XML document:

<?xml version="1.0" encoding="UTF-8"?><!-- WRONG! NOT WELL-FORMED XML! --><thing>Thing one</thing><thing>Thing two</thing>

XML provides special syntax for representing an element with empty content. Instead of writing a start tag followed immediately by an end tag, a document may contain the empty element tag (aka Singleton) where a slash follows the element name. The following two examples are functionally equivalent):

 <foo />

XML provides two methods for escaping (or simply representing) special characters: entity references and numeric character references.

An entity in XML is a named body of data, usually text, such as an unusual character.

An entity reference is a placeholder that represents that entity. It consists of the entity's name preceded by an ampersand ("&") and followed by a semicolon (";"). XML has five predeclared entities:

  • &amp; (&)
  • &lt; (<)
  • &gt; (>)
  • &apos; (')
  • &quot; (")

Here is an example using a predeclared XML entity to represent the ampersand in the name "AT&T":


If more entities need to be declared, this is done in the document's Document Type Definition (DTD). A basic example of doing so in a minimal internal DTD follows. Declared entities can describe single characters or pieces of text, and can reference each other.

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE example [        <!ENTITY copy "&#xA9;">        <!ENTITY copyright-notice "Copyright &copy; 2006, XYZ Enterprises">]><root>        &copyright-notice;</root>

When viewed in a suitable browser (or User Agent, in W3C terms), the XML document above appears as:

<root> Copyright © 2006, XYZ Enterprises </root>

Numeric character references look like entities, but instead of a name, they contain the "#" character followed by a number. The number (in decimal or "x"-prefixed hexadecimal) represents a Unicode code point, and is typically used to represent characters that are not easily encodable, such as an Arabic character in a document produced on a European computer. The ampersand in the "AT&T" example could also be escaped like this (decimal 38 and hexadecimal 26 both represent the Unicode value for the "&" character):


There are many more rules necessary to be sure of writing well-formed XML documents, such as the exact characters allowed in an XML name, but this quick tour provides the basics necessary to read and understand many XML documents.

Correctness in an XML document

For an XML document to be correct, it must be:

  • Well-formed. A well-formed document conforms to all of XML's syntax rules. For example, if a non-empty element has an opening tag with no closing tag, it is not well-formed. A document that is not well-formed is not considered to be XML; a parser is not allowed to process it.
  • Valid. A valid document has data that conforms to a particular set of user-defined content rules, or XML schemas, that describe correct data values and locations. For example, if an element in a document is required to contain text that can be interpreted as being an integer numeric value, and it instead has the text "hello", is empty, or has other elements in its content, then the document is not valid.

Well-formed documents

An XML document is text, which is a sequence of characters. The specification requires support for Unicode encodings UTF-8 and UTF-16 (UTF-32 is not mandatory). The use of other non-Unicode based encodings, such as ISO-8859, is admitted and is indeed widely used and supported.

A well-formed document must conform to the following rules, among others:-

  • One and only one root element exists for the document. However, the XML declaration, processing instructions, and comments can precede the root element.
  • Non-empty elements are delimited by both a start-tag and an end-tag.
  • Empty elements may be marked with an empty-element (self-closing) tag, such as <IAmEmpty />. This is equal to <IAmEmpty></IAmEmpty>.
  • All attribute values are quoted, either single (') or double (") quotes. Single quotes close a single quote and double quotes close a double quote.
  • Tags may be nested but must not overlap. Each non-root element must be completely contained in another element.
  • The document complies to its character set definition. The charset is usually defined in the xml declaration but it can be provided by the transport protocol, such as HTTP. If no charset is defined, usage of a Unicode encoding is assumed, defined by the Unicode Byte Order Mark. If the mark does not exist, UTF-8 is the default.

Element names are case-sensitive. For example, the following is a well-formed matching pair

<Step> ... </Step>

whereas this is not

<Step> ... </step>

The careful choice of names for XML elements will convey the meaning of the data in the markup. This increases human readability while retaining the rigor needed for software parsing.

Choosing meaningful names implies the semantics of elements and attributes to a human reader without reference to external documentation. However, this can lead to verbosity, which complicates authoring and increases file size.

Valid documents

An XML document that complies with a particular schema, in addition to being well-formed, is said to be valid.

An XML schema is a description of a type of XML document, typically expressed in terms of constraints on the structure and content of documents of that type, above and beyond the basic constraints imposed by XML itself. A number of standard and proprietary XML schema languages have emerged for the purpose of formally expressing such schemas, and some of these languages are XML-based, themselves.

Before the advent of generalised data description languages such as SGML and XML, software designers had to define special file formats or small languages to share data between programs. This required writing detailed specifications and special-purpose parsers and writers.

XML's regular structure and strict parsing rules allow software designers to leave parsing to standard tools, and since XML provides a general, data model-oriented framework for the development of application-specific languages, software designers need only concentrate on the development of rules for their data, at relatively high levels of abstraction.

Well-tested tools exist to validate an XML document "against" a schema: the tool automatically verifies whether the document conforms to constraints expressed in the schema. Some of these validation tools are included in XML parsers, and some are packaged separately.

Other usages of schemas exist: XML editors, for instance, can use schemas to support the editing process.


The oldest schema format for XML is the Document Type Definition (DTD), inherited from SGML. While DTD support is ubiquitous due to its inclusion in the XML 1.0 standard, it is seen as limited for the following reasons:

  • It has no support for newer features of XML, most importantly namespaces.
  • It lacks expressivity. Certain formal aspects of an XML document cannot be captured in a DTD.
  • It uses a custom non-XML syntax, inherited from SGML, to describe the schema.

XML Schema

A newer XML schema language, described by the W3C as the successor of DTDs, is XML Schema, or more informally referred to by the initialism for XML Schema instances, XSD (XML Schema Definition). XSDs are far more powerful than DTDs in describing XML languages. They use a rich datatyping system, allow for more detailed constraints on a XML document's logical structure, and are required to be processed in a more robust validation framework. XSDs also use an XML-based format which makes it possible to use ordinary XML tools to help process them, although WXS (W3C XML Schema) implementations require much more than just the ability to read XML.

Criticisms of WXS include the following:

  • The specification is very large, which makes it difficult to understand and implement.
  • The XML-based syntax leads to verbosity in schema description, which makes XSDs harder to read and write.
  • Schema validation can be an expensive addition to XML parsing, especially for high volume systems.
  • The modeling capabilities are very limited, with no ability to allow attributes to influence content models.
  • The type derivation model is very limited, in particular that derivation by extension is rarely useful.
  • Database-related data transfer has been supported with arcane ideas such as nillability but the requirements of industrial publishing are under-supported.
  • The key/keyref/uniqueness mechanisms are not type aware
  • The PSVI concept (Post Schema Validation Infoset) does not have a standard XML representation or API, thus it works against vendor independence unless revalidation is performed.


Another popular schema language for XML is RELAX NG. Initially specified by OASIS, RELAX NG is now also an ISO international standard (as part of DSDL). It has two formats: an XML based syntax and a non-XML compact syntax. The compact syntax aims to increase readability and writability but, since there is a well-defined way to translate the compact syntax to the XML syntax and back again by means of James Clark's Trang conversion tool, the advantage of using standard XML tools is not lost. RELAX NG has a simpler definition and validation framework than XML Schema, making it easier to use and implement. It also has the ability to use datatype framework plug-ins; a RELAX NG schema author, for example, can require values in an XML document to conform to definitions in XML Schema Datatypes.

ISO DSDL and Other Schema Languages

The ISO DSDL (Document Schema Description Languages) standard brings together a comprehensive set of small schema languages, each targeted at specific problems. DSDL includes RELAX NG full and compact syntax, Schematron assertion language, and languages for defining datatypes, character repertoire constraints, renaming and entity expansion, and namespace-based routing of document fragments to different validators. DSDL schema languages do not have the vendor support of XML Schemas yet, and are to some extent a grassroots reaction of industrial publishers to the lack of utility of XML Schemas for publishing.

Some schema languages not only describe the structure of a particular XML format but also offer limited facilities to influence processing of individual XML files that conform to this format. DTDs and XSDs both have this ability; they can for instance provide attribute defaults. RELAX NG and Schematron intentionally do not provide these infoset augmentation facilities.

International use

XML supports the direct use of almost any Unicode character in element names, attributes, comments, character data, and processing instructions. Therefore, the following is a well-formed XML document, even though it includes both Chinese and Cyrillic characters:

<?xml version="1.0" encoding="UTF-8"?><俄语>Данные</俄语>

Displaying XML on the web

Because XML is a data description language, XML documents do not carry information about how to display the data. Without using CSS or XSL, a generic XML document is rendered as raw XML text by most web browsers. Some display it with 'handles' (e.g. + and - signs in the margin) that allow parts of the structure to be expanded or collapsed with mouse-clicks.

In order to style the rendering in a browser with CSS, the XML document must include a reference to the stylesheet:

<?xml-stylesheet type="text/css" href="myStyleSheet.css"?>

See the CSS article for an example of this in action.

Note that this is different from specifying such a stylesheet in HTML, which uses the <link> element.

Extensible Stylesheet Language (XSL) can be used to alter the format of XML data, either into HTML or other formats that are suitable for a browser to display.

To specify client-side XSL Transformation (XSLT), the following processing instruction is required in the XML:

<?xml-stylesheet type="text/xsl" href="myTransform.xslt"?>

Client-side XSLT is supported by many web browsers, but not Opera before version 9.0. An alternative, rather than being dependent on the end-user's browser capabilities, is to use XSL to convert XML into a displayable format on the server. The end-user is not aware of what has gone on 'behind the scenes'; all they see is well-formatted, displayable data.

See the XSLT article for an example of server-side XSLT in action.

XML extensions

  • XPath makes it possible to refer to individual parts of an XML document. This provides random access to XML data for other technologies, including XSLT, XSL-FO, XQuery etc. XPath expressions can refer to all or part of the text, data and values in XML elements, attributes, processing instructions, comments etc. They can also access the names of elements and attributes. XPaths can be used in both valid and well-formed XML, with and without defined namespaces.
  • XQuery is to XML what SQL and PL/SQL are to relational databases: ways to access, manipulate and return XML.
  • XML Namespaces enable the same document to contain XML elements and attributes taken from different vocabularies, without any naming collisions occurring.
  • XML Signature defines the syntax and processing rules for creating digital signatures on XML content.
  • XML Encryption defines the syntax and processing rules for encrypting XML content.
  • XPointer is a system for addressing components of XML-based internet media.

Processing XML files

SAX and DOM are object oriented programming APIs widely used to process XML data. The first XML parsers exposed the contents of XML documents to applications as SAX events or DOM objects.

SAX is a lexical, event-driven interface in which a document is read serially and its contents are reported as "callbacks" to various methods on a handler object of the user's design. SAX is fast and efficient to implement, but difficult to use for extracting information at random from the XML, since it tends to burden the application author with keeping track of what part of the document is being processed. It is better suited to situations in which certain types of information are always handled the same way, no matter where they occur in the document.

DOM is an interface-oriented API that allows for navigation of the entire document as if it were a tree of "Node" objects representing the document's contents. A DOM document can be created by a parser, or can be generated manually by users (with limitations). Data types in DOM Nodes are abstract; implementations provide their own programming language-specific bindings. DOM implementations tend to be memory intensive, as they generally require the entire document to be loaded into memory and constructed as a tree of objects before access is allowed.

Another form of XML Processing API is data binding, where XML data is made available as a custom, strongly typed programming language data structure, in contrast to the interface-oriented DOM. Example data binding systems are the Java Architecture for XML Binding (JAXB) [6] and the Strathclyde Novel Architecture for Querying XML (SNAQue) [7].

A filter in the Extensible Stylesheet Language (XSL) family can transform an XML file for displaying or printing.

  • XSL-FO is a declarative, XML-based page layout language. An XSL-FO processor can be used to convert an XSL-FO document into another non-XML format, such as PDF.
  • XSLT is a declarative, XML-based document transformation language. An XSLT processor can use an XSLT stylesheet as a guide for the conversion of the data tree represented by one XML document into another tree that can then be serialized as XML, HTML, plain text, or any other format supported by the processor.
  • XQuery is a W3C language for querying, constructing and transforming XML data.
  • XPath is a DOM-like node tree data model and path expression language for selecting data within XML documents. XSL-FO, XSLT and XQuery all make use of XPath. XPath also includes a useful function library.

The native file format of, AbiWord, and Apple's iWork applications is XML. Some parts of Microsoft Office 11 will also be able to edit XML files with a user-supplied schema (but not a DTD), and on June 2, 2005 Microsoft announced that, by late 2006 all the files created by users of its Office suite of software will be formatted with web-centered XML specifications. There are dozens of other XML editors available.

Versions of XML

There are two current versions of XML. The first, XML 1.0, was initially defined in 1998. It has undergone minor revisions since then, without being given a new version number, and is currently in its fourth edition, as published on August 16, 2006. It is widely implemented and still recommended for general use. The second, XML 1.1, was initially published on February 4, 2004, the same day as XML 1.0 Third Edition, and is currently in its second edition, as published on August 16, 2006. It contains features — some contentious — that are intended to make XML easier to use in certain cases[9] - mainly enabling the use of line-ending characters used on EBCDIC platforms, and the use of scripts and characters absent from Unicode 2.0. XML 1.1 is not very widely implemented and is recommended for use only by those who need its unique features.

XML 1.0 and XML 1.1 differ in the requirements of characters used for element and attribute names: XML 1.0 only allows characters which are defined in Unicode 2.0, which includes most world scripts, but excludes those which were added in later Unicode versions. Among the excluded scripts are Mongolian, Cambodian, Amharic, Burmese, and others.

Almost any Unicode character can be used in the character data and attribute values of an XML 1.1 document, even if the character is not defined, aside from having a code point, in the current version of Unicode. The approach in XML 1.1 is that only certain characters are forbidden, and everything else is allowed, whereas in XML 1.0, only certain characters are explicitly allowed, thus XML 1.0 cannot accommodate the addition of characters in future versions of Unicode.

In character data and attribute values, XML 1.1 allows the use of more control characters than XML 1.0, but, for "robustness", most of the control characters introduced in XML 1.1 must be expressed as numeric character references. Among the supported control characters in XML 1.1 are two line break codes that must be treated as whitespace. Whitespace characters are the only control codes that can be written directly.

There are also discussions on an XML 2.0, although it remains to be seen if such will ever come about. XML-SW (SW for skunk works), written by one of the original developers of XML, contains some proposals for what an XML 2.0 might look like: elimination of DTDs from syntax, integration of namespaces, XML Base and XML Information Set (infoset) into the base standard.

The World Wide Web Consortium also has an XML Binary Characterization Working Group doing preliminary research into use cases and properties for a binary encoding of the XML infoset. The working group is not chartered to produce any official standards. Since XML is by definition text-based, ITU-T and ISO are using the name Fast Infoset for their own binary infoset to avoid confusion (see ITU-T Rec. X.891 | ISO/IEC 24824-1).

Patent status

In October 2005 the small company Scientigo publicly asserted that two of its patents, U.S. Patent 5842213 and U.S. Patent 6393426 , apply to the use of XML. The patents cover the transfer of "data in neutral forms", according to their applications, which were filed in 1997 and 1999. Scientigo CEO Doyal Bryant expressed a desire to "monetize" the patents but stated that the company was "not interested in having us against the world." He said that Scientigo was discussing the patents with several large corporations.[8]

XML users and independent experts responded to Scientigo's claims with widespread skepticism and criticism. Some derided the company as a patent troll. Tim Bray described any claims that the patents covered XML as "ridiculous on the face of it"[9]. Because there exists a large amount of prior art relating to XML, some legal experts believed it would be difficult for Scientigo to enforce its patents through litigation.

See also


  1. ^ Bray, Tim; Jean Paoli, C. M. Sperberg-McQueen, Eve Maler, François Yergeau (September 2006). Extensible Markup Language (XML) 1.0 (Fourth Edition) - Origin and Goals. World Wide Web Consortium. Retrieved on October 29, 2006.
  2. ^ Bray, Tim (February 2005). A conversation with Tim Bray: Searching for ways to tame the world’s vast stores of information. Association for Computing Machinery's "Queue site". Retrieved on April 16, 2006.
  3. ^ (1988) “Publishers, multimedia, and interactivity”, Interactive multimedia. Cobb Group. ISBN 1-55615-124-1.
  4. ^ The working group was originally called the "Editorial Review Board." The original members and seven who were added before the first edition was complete, are listed at the end of the first edition of the XML Recommendation, at [1].
  5. ^ For some data on compressibility as related to tag name length, see [2].
  6. ^ For example, XSL Schema Definition Language, described at [3]
  7. ^ For example, see S. Bauman, "TEI Horsing Around", Proceedings of Extreme Markup Languages 2005, Montreal [4]
  8. ^ For one early method of handling very large SGML documents quickly, see US Patent 5,557,722.
  9. ^ Extensible Markup Language (XML) 1.1 (Second Edition) - Rationale and list of changes for XML 1.1. W3C. Retrieved on 2006-12-21.



  • W3C XML homepage
  • The XML 1.0 specification
  • The XML 1.1 specification

Tutorials and FAQs

  • The XML FAQ
  • - Commercial site with many articles on XML technologies
  • Annotated XML Specification
  • Absolute Beginners' XML Tutorial
  • W3 Schools - Learn XML
  • XML: Some hyperlinks minus the hype by Philip Wadler
  • Caffè XML
  • XML Resource directory including specifications, articles, and tutorials.
  • The sbVB XML and systems integration course - A free course on XML using Apache's Xerces (for C++ and Java)


  • Lawrence A. Cunningham (2005). "Language, Deals and Standards: The Future of XML Contracts". Washington University Law Review. SSRN 900616.


See XML editor for editors and other editing tools.


  • Microsoft XML Parser (MSXML) specification
  • Expat XML Parser in C in
  • Apache Xerces
  • dom4j Open source library for working with XML, XPath and XSLT on the Java platform
  • CookXML XML Parser for Java
  • TinyXML Parser for C++ programmers
  • XimpleWare's VTD-XML XML Parser in both C and Java
  • Stefan Heymann's free XML Parser for Delphi
  • Microsoft's XML library for the .NET framework
  • The XML C parser and toolkit of Gnome
  • XSDBench XML Schema benchmark that compares the performance of validating XML parsers
  • Trolltech's Qt framework contains an XML library with both DOM and SAX APIs

Mailing lists

  • XML-DEV Mailing List

Data mining systems

  • System for mining the content and structure of XML documents


  • XML Diff Utility
Retrieved from ""