|
||||||||||||||||||||||||||||||||||||||||||
XML stands for eXtensible Mark-up Language. XML is a simple, flexible text-based format that is derived from Standard Generalised Mark-up Language (SGML). XML standards are developed by the World Wide Web Consortium (W3C).
A mark-up language is a standardised and structured method of creating a text file that contains data intended for consumption and processing by computers. While documents written in mark-up languages can be read by people, they are primarily read by machines. As a result they are not well suited for human reading. The most common form of mark up language is HTML (HyperText Mark-up Language). This is the language used for the internet. HTML documents contain the information to be displayed and instructions for displaying the information.
Below is an example of data marked-up using HTML and the resulting rendering of the mark-up as it would be displayed by a browser. The data is a water level observation plus the date and time that the observation was made.
<table>
<tr>
<td><b>Date and Time</b></td>
<td>2009-06-06 12:00:00</td>
</tr>
<tr>
<td><b>Water level</b></td>
<td >1.234</td>
</tr>
</table>
| Date and Time | 2009-06-06 12:00:00 |
| Water level | 1.234 |
In the HTML encoding, the data is easily visible for human reading but it is essentially hidden for machine reading. The mark up contains data and instructions on how to display the data. The instructions tell the browser to place the data into a table and to bold the text in the first column.
The resulting browser output can be easily read by a person who would reasonably determine that the water level was 1.234 at 12:00 on 06/06/2009.
If a computer read this mark-up, it would have difficulty extracting anything of value without making assumptions. Assumptions that would enable data to be read might include:
Because this document was designed for presenting rather then delivering data, changes in the HTML output layout may lead to an inability for a computer to extract the required data.
The eXtensible Mark-up Language is used for delivering data and does not contain formatting instructions. In a minimal case, a full XML document used to deliver the data for the above example may look like the code below.
<?xml version="1.0"?>
<wdtf:HydroCollection
<wdtf:TimeSeries>
<wdtf:timeValuePair time="2009-06-06T12:00:00+10:00">1.234</wdtf:timeValuePair>
</wdtf:TimeSeries>
</wdtf:HydroCollection>
In this example it is possible for a computer to unambiguously read the time attribute and determine the value of the timeValuePair, however the format and meaning of these items can only be assumed unless it is defined somewhere.
XML is a mark-up language that enables data transfer. The language is a standard administered by the World Wide Web Consortium (W3C) see http://www.w3.org/XML/. The definition of the mark-up language does not control the content being represented in an XML document. Control of the structure and definition of content within a document is through the proclamation and use of formats and standards that use XML (and other formats) to encode data. Proclaimed formats can be used to ensure that data can be passed between organisations without a loss of meaning.
The XML fragment below builds on the minimal case example by adding references to standards schemas and format schemas that are being used to define the structure and meaning of the XML data document.
<?xml version="1.0"?>
<wdtf:HydroCollection
xmlns:sa="http://www.opengis.net/sampling/1.0/sf1"
xmlns:om="http://www.opengis.net/om/1.0/sf1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:gml="http://www.opengis.net/gml"
xmlns:wdtf="http://www.bom.gov.au/std/water/xml/wdtf0.3"
xmlns:ahgf="http://www.bom.gov.au/std/water/xml/ahgf0.1"
xsi:schemaLocation="http://www.opengis.net/sampling/1.0/sf1 ../sampling/sampling.xsd
http://www.bom.gov.au/std/water/xml/wdtf0.3 ../wdtf/water.xsd
http://www.bom.gov.au/std/water/xml/ahgf0.1 ../ahgf/waterFeatures.xsd"
<wdtf:TimeSeries>
<wdtf:timeValuePair time="2009-06-06T12:00:00+10:00">1.234</wdtf:timeValuePair>
</wdtf:TimeSeries>
</wdtf:HydroCollection>
Inclusion of these references means that the data can now be read unambiguously and more importantly, the meaning of the contents is declared.
The internet is full of XML related information, a few valuable references include:
Home | About Us | Learn about Meteorology | Contacts | Search | Help | Feedback Weather and Warnings | Climate | Hydrology | Numerical Prediction | About Services | Registered Users |
|
© Copyright Commonwealth of Australia 2009, Bureau of Meteorology (ABN 92 637 533 532) Please note the Copyright Notice and Disclaimer statements relating to the use of the information on this site and our site Privacy and Accessibility statements. Users of these web pages are deemed to have read and accepted the conditions described in the Copyright, Disclaimer, and Privacy statements. Please also note the Acknowledgement notice relating to the use of information on this site. No unsolicited commercial email. |