|
The recent introduction of XML has stirred quite a
confusion on the nature of XML, probably because
it is often advertised as a "markup language", one similar to
HTML. Well, you are half right, XML
is here to stay but it will not
replace HTML, in fact, the two are complimenting
each other's reign on the internet. HTML is used to dictate
the layout of your document, with HTML, you can display data, set values such
as colors, text size & name, create tables and so on. However, these data used
by HTML, so far, are available locally only and they cannot be
shared with other documents, this can't be a good thing when it
comes to the ubiquity of the
multi-platform internet.
The reason the data
in an HTML document can't be
recognized/implemented by/into another document is due to the
unorganized structure of the HTML document itself. Yes,
HTML does have tagging structures, not logically organized;
nevertheless, what we are talking about is the chunks of data itself
not how they are displayed. Still confused?
Good!. This is where XML comes in, although using a
similar "markup language" syntax as HTML, XML does not dictate
how data are displayed, it only organizes relevant data into neat
packets of logical standing so that any script embedded in an
HTML document can decipher, then to display.
XML follows a very
strict use of rules, an open XML tag must be closed with a close
tag, attributes' value must be enclosed in quotation mark--in HTML,
you can ignore these things without interrupting the
programming flow, not with XML though! Tags in XML are
user defined...anyway, let's not go further, the technical
facts are not intended in the scope of this article. In
general, we need a new format aimed to standardize the way
we deliver data and XML is the "man" for the job. You may
argue that "What about databases, aren't they structurally organized
and can store gigabytes of data?!" Well, yes, but tell that to
Microsoft and Oracle, see the problem now? Databases are ideal
to store data, but since they are system-dependent, they need
their own parent software to decipher before delivering to the
audience. On the other hand, as long as you set
your data the XML way, any programmer from any
other system can logically retrieve the data--in this
case, XML is the
"middle-man"!
Example: <MySchedule> <Date
ID="1/4/2001">
<Hour1>Sleep</Hour1>
<Hour8>Wake up</Hour8>
<Hour9>School</Hour9>
</Date> </MySchedule>
As you can clearly see, XML is a
text-based language, the tag names are whatever makes sense to
you, the data are orderly organized from root to child elements,
this way, your data can be retrieved with logical programming.
In real life, for instance, as a news agency is distributing out
their reports in structured XML, the receivers have their
own script to interpret the universally structured data
and then to incorporate it into their own system;
this whole process is possible without having all
parties equipped with the same type of
system. |