Home » Categories » Solutions by Business Process » E-Business » XML

Example of XML Document

Datafile Software

Example of XML Document


The example below is taken from Microsoft’s Introduction to XML, from their web-site, and is a weather report.

† BASDA — Business Accounting Software Developers Association, a UK initiative that now includes most of the world’s major accounting and commercial software companies, including Datafile Software

What is immediately apparent is how easy it is to read this and understand what it means. It might as well say "Weather report dated March 25th, 2003 at 8.00 a.m. from Seattle, WA, in the West Coast region of the USA. Skies will be partly cloudy, temperature 46ºC, wind direction from the southwest of force 6. The humidity index is 51, with a humidity of 87%, visibility 10 miles, and a U/V index of 1”.

What should also be apparent to someone who has some familiarity with HTML is how similar to an HTML page this XML document looks. Content that is clearly data (such as the date and time) are "tagged†” front and back just like the content in an HTML page.

HTML, however, has a limited number of pre-defined tags — such as "<h1>” "<h2>” and so on to define heading levels — and their meaning and uses (or semantics) are fully defined by HTML standards. In XML, neither the set of allowable tags nor their semantics are defined by the XML standard.

In fact XML is really a meta-language for describing a markup language, telling you how to define tags and the structural relationships between them that — taken as a whole — define the complete document. Provided you stick to the few rules, how you use this language to create an XML document is up to you.

The combination of an opening and closing tag together with everything in between is known in XML as an "element”. The top-level element — in the example above, weather-report — is known as the "root” element. Any element below another element is known as a "child” element. In the example above, date, time, area and measurements are all child elements of weather-report; wind is a child element of measurements, and direction is a child element of wind.

Within the opening tag may be additional information, known as attributes, that may modify how the data between the tags is to be treated.

† "Tags” are enclosed within angle brackets "<” and ">”, and the closing tag starts "</”. In the example above "<date>”and "</date>” are the start and end tags for the date given: "2003-03-25”.
Custom Fields
  • Release ID: Standard
Attachments Attachments
There are no attachments for this article.
Related Articles RSS Feed
Run-Time Document Processing Errors
Viewed 1992 times since Mon, Jul 9, 2012
Diagnostic XML File Print
Viewed 3788 times since Mon, Jul 9, 2012
General Lookup File - Appendix 6
Viewed 2062 times since Tue, Jul 10, 2012
Application Screen Changes
Viewed 2130 times since Tue, Jul 10, 2012
test
Viewed 2636 times since Mon, Jul 9, 2012
Database Profile Copy Items
Viewed 1967 times since Tue, Jul 10, 2012
XML Audit Trail Report
Viewed 1986 times since Thu, Jul 5, 2012
Lookup File Structure
Viewed 4533 times since Tue, Jul 10, 2012
Purchase Ledger Transactions
Viewed 2038 times since Tue, Jul 10, 2012
Purchase Ledger Accounts
Viewed 2034 times since Tue, Jul 10, 2012