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
XML Transaction Definition
Viewed 1505 times since Mon, Jul 9, 2012
addto
Viewed 1258 times since Mon, Jul 9, 2012
Linking to POP Document Layouts
Viewed 1350 times since Mon, Jul 9, 2012
Purchase Ledger Accounts
Viewed 1360 times since Tue, Jul 10, 2012
Other Lookup Parameters
Viewed 1257 times since Mon, Jul 9, 2012
Update EAN/Products from Stock
Viewed 1452 times since Thu, Jul 5, 2012
Application Considerations - Other Considerations
Viewed 1327 times since Tue, Jul 10, 2012
Checking an XML Template
Viewed 1326 times since Mon, Jul 9, 2012
Print Invoices Processed
Viewed 3053 times since Mon, Jul 9, 2012
Sales Ledger Transactions (SLT)
Viewed 1657 times since Tue, Jul 10, 2012