XML Tutorial
This short XML Tutorial will show you the very
basics of XML and some real world applications.
XML was designed to describe data and focus on what
data is.
What is XML?
- XML stands for EXtensible Markup Language
- XML is a markup language much like HTML
- XML was designed to describe data(store data)
- XML tags are not predefined in XML. You must define
your own tags
XML is really just a flat file database!
Here is a very simple XML file....
<?xml version="1.0"?>
<XML>
<row>
<ID>1</ID>
<Product>Bar Business Plan</Product>
</row>
<row>
<ID>2</ID>
<Product>Car Wash Business Plan</Product>
</row>
<row>
<ID>3</ID>
<Product>Child Care Business Plan</Product>
</row>
<row>
<ID>4</ID>
<Product>Coffee Shop Business Plan</Product>
</row>
<row>
<ID>5</ID>
<Product>Day Care Business Plan</Product>
</row>
<row>
<ID>6</ID>
<Product>Internet Business Plan</Product>
</row>
<row>
<ID>7</ID>
<Product>Night Club Business Plan</Product>
</row>
<row>
<ID>8</ID>
<Product>Real Estate Business Plan</Product>
</row>
<row>
<ID>9</ID>
<Product>Retail Business Plan</Product>
</row>
<row>
<ID>10</ID>
<Product>Tanning Salon Business Plan</Product>
</row>
</XML>
Simply copy this file into notepad and save it as tutorial.xml
OR - simply download the XML
Tutorial file.
Now view the file in internet explorer version 5+ or
another browser which is XML compliant.
Using XML - Real world examples
This has probably been the shortest XML Tutorial out there - but I didn't want to get too deep - at the
end of the day XML is just a way of describing data
- it is very simple.
Now let's use this very XML file to create data
driven graphics using Dreamweaver Fireworks MX!!
If you visit the business plans part of this site and click on a business plan e.g. Bar
Business Plan you will see part of the template the image at the top right has that text on it.
Now that part of the site has 2000+ images like that - imagine creating
each image by hand!!
XML Vs HTML
XML purely defines the data where as HTML has the data
embedded into the document and formats it too using
<p>, <br>, <font> tags etc.
Now different companies may want to display this data
in different ways - different company logo, larger font
, different font etc. etc.
With an XML file they can use different schemas to
create their look and feel whereas with HTML they would
have to strip the data out of the file which takes time
- this way several companies can exchange data and format
it how they wish.
Another benefit is that if you are sending purely an
XML file in a data exchange it is far less information
than sending information and how that information is
formatted.
|