XML (Extensible Markup Language) is a markup language which is used for storing data and to exchange data between computers.
In XML it’s possible to represent data hierarchical so any existing business model or data structure can be reflected. An XML document consists of begin tags and corresponding end tags. In between the tags data can be placed. Each tag can have an umlimited number of attributes. A begin-end tag can embrace another tag, so it’s possible to embed tags under each other. This is the principle which makes XML hierarchical.
Example of an XML document:
Below is listed an example of an XML document which has a list of persons and some data for each person.
<?xml version="1.0" encoding="UTF-8"?>
<personlist>
<person id="*1*" someproperty="*property data*">
<name>John</name>
<address>
<road>Apple road 4</road>
<city>Exampleville</city>
<zip>8520</zip>
</address>
<profession>IT-architect</profession>
</person>
<person id="*2*" someproperty="*property data*">
<name>Bill</name>
<address>
<road>Orange road 298</road>
<city>Testtown</city>
<zip>9999</zip>
</address>
<profession>Police officer</profession>
</person>
</personlist>
The start tag has a corresponding end tag at the end of the document. An end tag is characterized by a slash (/) character. In between two persons are listed. Each person has two properties, “id” and “someproperty”. In this example tags are colored in blue, attributes in red, attribute data in dark blue and data in black. When editing XML documents it’s adviced to use an editor which is able to format the XML in the correct colors and indentation, for instance an editor like “Notepad++”.
Post your comment on this topic.