XML Script logo next up
An introduction to XML data
Introduction

XML, 'Extensible Markup Language', is a format for describing data. XML data consists of elements, often called objects. Elements can contain attributes and content; the content may, in its turn, consist of further elements. This hierarchical structure is ideal for representing many kinds of data. The syntax of XML is very similar to HTML and, like HTML, XML is a subset of SGML. However, unlike HTML, the names of the elements and attributes are not predetermined - this is what makes XML 'extensible'. Within certain limits, any appropriate labels can be used to describe elements and attributes.

Elements

An element is delimited by a start tag (a word enclosed in angle brackets) and an end tag (identical to the start tag, but including an initial forward slash). Note that XML is case-sensitive: the capitalisation of the start and end tags must be identical.

<Element >
</Element>
Attributes

An element may have attributes, which are included within the start tag.

<Element attribute="yellow" >
</Element>
Content

An element may also have content, which lies between the two tags.

<Element attribute="yellow" >
Text content
</Element>
Sub-elements

Content can also be, in its turn, further elements or objects, or a combination of text and elements.

<Element attribute="yellow" >
Text content
<SubElement >More text content</SubElement>
Even more text content
</Element>
Empty elements

An element which has no content may be denoted either with separate start and end tags or, alternatively, with a single tag which includes a trailing forward slash (this is called an empty-element tag).

<Element attribute="yellow" />
Next...

XML Script homepage | Documentation home | XML Script docs | Command list | Function list | X-Tract docs

X-Stream, X-Tract and XML Script are trade marks of DecisionSoft Limited
© Copyright 1998-2000 DecisionSoft Limited