Sunit Katkar's Home Page

 Tutorials:
 

Welcome to my XML & XSL pages

Just a few words...

In mid 1997, there was talk about XML as being the next happening thing on the web. Honestly, I did not pay much attention thinking that I would look at it later. At that time, HTMl and DHTML and newer versions of Javascript were emerging and these skills were in demand along with server side programming. I could not get more information about XML from the internet as there was very little except the W3C draft and proposal, etc.

I started using XML since early 2000 in my work. By then XMl had become a full blown paradigm for information exchange. Today it is quite importrant and many business and other processes use XML as a means to store, manipulate and exchange data across a variety of computing platforms.

Along with XML came XSL which was necessary to convert XMl into browser displayable HTML. Today XSL is also an integral part of systems using XML because it offers a very structured and clean approach for rendering XML documents.

There were very few sites which explained some concepts quite clearly and kept away from the usual fluff surrounding a new technology or standard. Now you might ask, why do I intend to put up XML tutorials on my site so late in the day? Well, believe me that there are folks like me who have programmed for quite sometime but have not necessarily had the time, due to valid reasons, to dwell on and learn every new thing that came across. This is a small effort to help others to understand the basic workings of XML.

What did I understand about XML?

When I first started reading and learning about XML, there was the usual hype on many sites. People went into lengthy discoruses about how dramatically things would change forever once XML was adopted. Not one site explained in simple terms that "This is XML and this is how you write it and this is how you interpret it and .... ".

Okay this is what I think that XML means in a simple sentence: XML does to data what HTML does to simple text.

Taking it further, HTML is for formatting and rendering your textual data, whereas XML is for formatting and organising your data in a textual format.

Those of you who have worked with or are familiar with EDI (Electronic data Interchange) will understand it better this way - EDI has proprietary tags for each application whereas XML is a open standard and you can think of XML as a very flexible form of EDI

Furthermore, HTML has a well defined set of TAGS like <P>, </P>, <BR>, etc. With XML you can define your own tags to structure your document.

Oh no , why should I learn one more technology?

Why use XML when you have a plethora of RDBMS' ?

Well, not all documents and textual data is fit for converting into the relational domain. Many applications already have vast amounts of data storedin RDBMS' like Oracle® ort MS SQLServer ®. You must have used applications which access this data via specially written client programs. Maybe you have used a web application which renders this data on your browser. Again, every client has to be written using a appropriate language on a particular platform and thus becomes restrictive for access from any interface other than the one it was written for.

Now if you were to exchange this data with some other new interface, say a Palm Pilot ® or a WAP enabled Cell Phone. This would pose a considerable challenege as you would have to write the middle ware for each platform.

But if you had a middle ware application which output all the data as pure XML then it would be pretty simple to access it from any interface because all you would need to do is write or make available a XML parse for that particular platform. This is much easier than writing proprietary applications for each interface and platform.

XML: A new way to organise your documents

XML allows you to structure your documents as logical data units. For example, you might be a recruiting manager in the Humnan Resources dept. of a company. Now, you get several resumes everyday from different candidates via email for a prospective position in your company. The most commonly used editor for resumes is MS Word ® but many use other document formats to send you resumes. Some in plain text while some using Adobe Acrobat® PDF format. Typically a resume has the following information at the very least :

  • contact information
  • academic qualifications
  • skill set summary (like C++, VB, Perl, etc.)
  • work experience (like how many years, etc.)
  • Project summary (like what you did at each company, etc.)
  • other things as per your area of expertise...

Now if you were to search a particular set of candiates based on skills like Java programming language, then how would you go about it?

Each individual uses a variation of the above points in his/her resume. Now there is no standard way to sift through these and get what you want easily unless you read atleast the Skills summary of each resume. Would it not be convenient if all resumes followed a standard format? Then you could write a program to search and extract the exact information you were looking for from the tons of documents you had.

Without a uniform way of writing resumes, it becomes very difficult and time consuming to qucikly access the information you are looking for.

If you still aren't satisfied, then there are agood many articles and sites that explain why you should use XML. For starters, check this site XML.COM

XML to the rescue

With XML in force, all resumes would have the same defining tags. Then you could use any of the standard XML parsers and tools that are available to search the cards. We will create a very simple set of business cards based on XML.

Before I get into DTDs and other nuances of XML, we will build and see this simple resume example in the next section. I do not intend to repeat a lot of things here like details of a DTD or indepth coverage of writing DTDs and so on. This information is readily available on the web and from more authoritative sources.

Note: Before you think of XML as a complete solution to your documents or data problems, please bear in mind that a XML document is only worth and effective as its formatting. I mean, if you have not taken care to define proper tags and broken down the document into proper logical units, your newly converted XML documents will not be quite effective as a data storage of logical units of information. So your documents are only good as the proper structured tags in it.

Click here for the first example

Main |  1 |  2 |  3 |  4