XML is the Extensible Markup Language, this is a structured document for containing large amounts of information. This information can be make up of words and images. The XML structure is designed to identify and isolate the different parts of information and content contained within the structured document. XML is a full mark-up programming language and can be closely compared due to similarities with the HTML programming language, though they are very different. XML has many different uses and was created so lots of different information can be contained within it, unlike HTML where it is only designed for specific content to be used and the tags used and pre-defined. In XML the tags are custom so there is no tag list meaning there is no already set information regarding the content of the tags.
XML is stored in a plain text format and many programs can read the language but only specialised ones can interprit it depending on what you are looking to use it for. XML has many different uses, according to http://www.w3schools.com/xml/xml_syntax.asp some of these include:
Seperating data from HTML - This is where information for websites can be stored in an external or seperate XML file and read later by another language (html, php) when being pulled on the page, the advantages of this are that the html code can be dedicated to other features of styling the appearance of the website or organising placement of content.
Exchanging data - XML allows easier storage of data and information, programs can be used that make storing information inside XML files more secure and easy to access making exchanging it between software (such as the Microsoft Office applications) much easier.
Creating new software languages - As an example the WML (Wireless Markup Language) which is used for mobile technology on hand held devices, XML is the parent language of this one.
There are many other uses for the language including the use of RSS which is also written in XML. The language has very specific syntax rules based on how it should appear and be written, a peice odf code that follows these standards is known as one that is ‘well-formed’. A well-formed document will be easily read by any program or website very easily with no problems at all, though if a document fails to reach every standard it becomes not well-formed and attempts to read it are surely going to fail. To be well formed there are over 100 rules that must be followed, these are available to read here W3 XML. The W3 also defines a simple set of rules that must be followed for well-formed to be acheived
- XML documents must have a root element
- XML elements must have a closing tag
- XML tags are case sensitive
- XML elements must be properly nested
- XML attribute values must be quoted
Source: http://www.w3schools.com/Xml/xml_dtd.asp
They also give an example of what a simple well formed peice of XML would look like, it complies to the simplest of standards with an opening and a closing tag, a root node and all elements within the code are properly nested.
<?xml version="1.0" encoding="ISO-8859-1"?> <note> <to>Tove</to> <from>Jani</from> <heading>Reminder</heading> <body>Don't forget me this weekend!</body> </note>
The elements within the structured text must be in a tree format, tizag.com shows how the tree structure fits in easily with the XML concept shown using indenting here is an example:
<inventory> <drink> <lemonade> <price>$2.50</price> <amount>20</amount> </lemonade> <pop> <price>$1.50</price> <amount>10</amount> </pop> </drink> <snack> <chips> <price>$4.50</price> <amount>60</amount> </chips> </snack> </inventory>
You can easily see that the structure is the same principal as HTML, and within each of the “nodes” are more nodes which gives it the tree structure that appears. Within all XML must be a root element which in this case is the inventory, within that are descending nodes like drink which is the ancestor node of lemonade. Each of the nodes include a closing tag so it is known where they begin and end, and which node is the ancestor of which. Here is a diagram showing how this is formed within a tree:
XML is useful for many different applications and is used widely for the web and other resources, it is excellent at storing and compressing data but relies upon specific software to read it. It has been implimented in various different popular applications including Microsoft Office 2007 which uses the XML file format as it’s own format.
Resources
http://www.developer.com/tech/article.php/797861
http://www.tizag.com/xmlTutorial/xmltree.php
http://www.xml.com/pub/a/98/10/guide0.html?page=2#AEN63
http://assit1.ucsm.ac.uk:8080/bodington/site/ist205/week7/reading/xml-apps.pdf


