XML Overview

Overview

XML (Extensible Markup Language) is a set of rules for encoding documents electronically. It is defined in the XML Specification produced by the W3C and several other related specifications. XML’s design goals emphasize simplicity, generality, and usability over the Internet. It is a textual data format, with strong support for the languages of the world via Unicode.

By definition, an XML document is a string of characters. Almost every valid Unicode character may appear in an XML document. The processor is often referred to colloquially as an XML parser.

Characters that make up an XML document are divided into markup and content. Markup and content can be distinguished by applying simple syntax rules.

All markup strings either begin with the "<" and end with the ">" character (also called Node) or begin with the character "&" and end with a ";". Strings of characters that are not markup are content.

Tags come in three flavors:

Characters between the start and end tags, if any, are the element's content and may contain markup, including other elements, which are called child elements. Simple example: root stock element with utils in it :

Complex sample - legend with different elements in it and these elements contain data in them:

A markup construct that consists of a name/value pair, set within a start tag or an empty-element tag, is Attribute. In the example, the png_image element has three attributes - size, width, height:

The characters "<" and "&" are the key syntax markers and may never appear in the content; some character encodings support only a subset of Unicode.

An XML document must be valid (fit the structure of the Scheme) and well-formed (meet the requirements of the specification).

to top

XML Reference

If you want to know which specific attributes can be used in a certain node, and/or what are all the possible attribute values - use XML Reference that lists all the nodes and attributes.

to top

XML Schema

XML Schema is used for expressing a set of rules, which an XML document must conform to in order to be considered 'valid' according to that scheme. If you are interested in this subject, move on to XML Schema.

to top

Well-Formedness and Error Handling

The XML specification defines an XML document as a text, which is well-formed, i.e. meets the requirements of the list of syntax rules provided in the specification. To manually check well-formedness, you can open the XML config file in any browser and check its structure.

Here you can see an example of an error occurred when an end tag (</stock> in this instance) is missing:

Another error occurs on an unclosed attribute quote:

When this typo has been resolved, the browser has built a correct XML tree:

to top

Validation

To validate your XML config, you can refer to XML Schema or use the Online Validator tool.

to top