|
| |
| |
|
XML stands for EXtensible Markup Language. XML is used to describe and carry
data.
|
<?xml version="1.0"?>
<Library>
<Book>
<FirstName>Nelson</FirstName>
<Surname>Walsh</Surname>
<Year_Published>1994</Year_Published>
<Quantity>12</Quantity>
<Title>Metal Prison</Title>
<Price>$10.95</Price></Book>
</Library> |
|
You may not think this looks like a database or a data file,
since XML was not designed display data.
|
|
There are many ways to display the data in a XML document. One way is to use
XSL (the eXtensible Stylesheet Language). With XSL you can display information
in your XML document.
Here is an example of a normal XML document:
|
|
Here are simple examples of how you can display the same XML document, using
XSL: |
|
Just one of the main advantages of using XML to carry your data, is that you
can display one XML document in different ways, without carrying out major
changes in your XSL document.
|
|
Documents such as WebPages consist of both "data" and
"display".
The following "data" consists of names and ages:
|
| Name |
Age |
| Walsh, Nelson |
46 |
| Sheila, Thornton |
73 |
| Tommy, Sliver |
32 |
|
The following "display" is a table:
|
|
when we put the data into the table we get the following output:
|
| Name |
Age |
| Walsh, Nelson |
46 |
| Sheila, Thornton |
73 |
| Tommy, Sliver |
32 |
|
HTML was designed to both carry and display data. |

|
Whilst XML was designed to carry the data, and XSL was designed to display
the data. |

|
Using HTML means that if you want to make any changes to the data part of the
document, then you would have to make changes to the part that defines the
display of the document, and vise versa. Whilst in XML and XSL the data and
display are separated, so that changes in one does not affect the other.
Since HTML consists of both the data and the display of the document, then
that would mean you can only have one output of the document. Whilst using XML
and different XSL documents, means that you can have more than one output of a
document.
|

|
This is just one of the reason why XML is becoming more and more popular. |
| | |
|