November 12, 2019

Introduction to eXtensible Markup Language (XML)

 

XML is:

  • A subset of SGML
  • Developed for deployment over the Web (SGML is too complex for Web apps)
  • Not a replacement for HTML
  • As easy to use as HTML, but with the benefits of SGML. In other words it can be easily written in a text editor and yet it is formal and concise.
  • Multi-platform (can be deployed on PC, Mac, PDA, mobile phone etc)
  • Easily read - a text file
  • Extensible - users can develop their own tags to convey the semantics of content.
  • Non-proprietary

Here is an example of how data can be structured using XML.

<?xml version="1.0" encoding="ISO8859-1" ?>
<CATALOGUE>
  <BOOK>
    <TITLE>Mystic River</TITLE>
    <AUTHOR>Dennis Lehane</AUTHOR>
    <GENRE>Crime Fiction</GENRE>
    <PUBLISHER>Bantam Books</PUBLISHER>
    <YEAR>2001</YEAR>
  </BOOK>
</CATALOGUE>

This XML file will hold data relating to a book collection. Note that an XML document must have a root element, in this case CATALOGUE (I could have called it anything I like - that's why it's eXtensible Markup Language). The nested element, BOOK, is a child element of CATALOGUE. Other child elements (TITLE, AUTHOR, GENRE, PUBLISHER, YEAR) have been further nested within the BOOK element. For simplicity I have included just one BOOK element. As with a relational database, this file could store thousands of identical data structures, each one representing the required data for a book.

Next page » Transformation of XML data using XSL

Previous page « HTML and Hyperlinking

 

 

 

 

 

 

 

 

 

 

 

 

Up to top of page