Jyoti Parthasarathy wrote:
> I have found a tutorial in www.msdn.microsoft.com
> http://msdn.microsoft.com/xml/all/ This is the url for the Tutorial on XML
> But it is pretty advanced.
> As far as how it is used in projects - I think some e-commerce projects use
> XMl though I do not know the URL for any such example.
>
> As T mentioned certainly databases are faster - but I think XML is just one
> way of transferring data across the net. It is as good as transferring a
> view to the database across the web.
> As far as I have understood,databases are reqd at both ends(server as well
> as client side). Only picking up data from the page and putting it into the
> database on the client side is simpler if XML is used.
> If somebody has another view plz share it.
>
> Jyoti
XML was thought of as next version of HTML 4.0. HTML 3.0 had certain fixed
number of tags. HTML 4.0 introduced a lot more tags to accomodate the ever
growing need for formats. But this had to stop. Why?
Firstly the tags used in HTML are fixed by what the browser can understand.
Theoritcally you can keep on introducing the tags. But practically the browser
has to implement them. Secondly, the tags were restricted to merely
presentational aspects and did not contain any information about the content of
the document.
Enter XML. XML by itself does not have any predefined tags. It is upto
different user communities to decide upon their tags. For e.g. book industry
might have tags like title, author, isbn, price etc. If you use XML then your
will have your data as follows
<xml version="1.0">
<books>
<book>
<title>An introduction to XML</title>
<author>Sameer Kochar</author>
<isbn>80-1289110</isbn>
<price>
<currency>Rs.</currency>
<amount>560.00</amount>
</price>
<book>
<book>
....................
</book>
<books>
Why has XML has been thought of as a layer above databases?
1) As XML follows the simple text format and has starting and closing tags. You
can have represent any hierarchy using XML. It is very easy to interpret the
XML.
For presenting the data to user there are styling languages available called
XSL (Extensible Styling Language) that can take your XML and apply formatting
to it. For e.g. the above XML can be converted using XSL as follows. I am
writing it in pseudo code
<xsl:stylesheet>
<HTML>
<HEAD>
</HEAD>
</BODY>
<table>
<caption> BOOKS </caption>
<tr>
<td>Title</td>
<td>author</td>
<td>isbn<td>
<td>price</td>
</tr>
apply the templates for the tags
</table>
a) TEMPLATE for every <books> tags encountered
<tr>
apply templates for the lower level tags(i.e book etc.)
</tr>
b) TEMPLATE for every <book> encountered
<td> value of the book tag </td>
c) TEMPLATE for every <author> encountered
<td> value of the author </td>
d) TEMPLATE for every <isbn> encountered
<td> value of the isbn tag </td>
e) TEMPLATE for every <price> encountered
<td> value of the price tag </td>
Now using the XML + XSL, I can produce the desired output. Now if you do it in
a servlet the output can go to the browser. If I want a different styling I can
just use a different XSL but the same XML.
ON the other hand, there does not exist any efficient mechanism to insert,
update, and query the data contained in XML. Hence you still need the good old
databases for that.
==--==--==--==--==--==--==--==--==--==--==--==--==--==
S.Ramaswamy
Matrix Infotech Syndicate
D-7, Poorti, Vikaspuri, New Delhi, 110018, India
PHONE: +91-11-5610050, FAX: +91-11-5535103
WEB http://MatrixInfotech.HyperMart.Net
==--==--==--==--==--==--==--==--==--==--==--==--==--==
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html