Jump to content

XML


dhpd22

Recommended Posts

Hey guys,I am reding the XML tutorials from w3school. I felt that learning XML is as easy as driving bicycle. But i have one question regarding XML that what is the use of the code that we generate in XML instead of HTML. w3 says that XML is used to describe data and HTML is for formatting the contents of the page but plz i need more clarification about the definition. Any one plz help me.Thanks Dheeraj. :)

Link to comment
Share on other sites

The syntax of XML is truly the easiest thing on the planet. Even more easier then HTML, scince the different empty tags. I remember how I wondered why aren't tags like "img" closed.It's concept however is the hardest thing to grasp. It took me weeks to figure it out on my own. I read the tutorial 10 times over, trying to figure it all out. However, explanation is not that easy.I suggest you learn XPath and then XSLT. Don't worry about the use case, just do it. When you reach XSLT, you will start to realize the use of XML. It separates data from presentation. You might call XML a text based database, though that's not entirely true.A simple example to illustrate it better. You type in a data about an office. Each employee has a different rank and sits on a different place at the office. Each desk has a different shape. You describe it all. Then, with one XSLT file, you create an XHTML representaion of what you have described. Employees are described in a table (for example). Then, with another XSLT file, you create a WML deck, for WAP enabled phones. With a third XSLT file you create an SVG graphic that turns the data into a map of the office, along with each employee's name standing where it should.Now, when a new employee takes place and/or an old one is replaced/fired you can simply make the adjustments in the XML file. All of the presentations will automatically redo the layout according to the changes in the XML.If you had made a static XHTML, WML and SVG files, then you would have to edit each of them, so it can be up to date.[edit] Oh, I forgot o mention the biggest advantage in all of this. You aren't requred to use a certain server side scripting language. It's a plus if that language has an XSLT processor, but it's still not requred and you can switch easily from one language to another. [/edit]

Link to comment
Share on other sites

Thanks boen_robot,I am very happy to hear frm u. Your suggestion will be very helpful for me. However ur given example is out of grasp. As u suggest I have started learning XPATH and XSLT.Thanks Dheeraj. :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...