Forum Moderators: phranque
Maybe there is something in the work flow of those who expound the benefits of XML that I'm missing. But it seems that it introduces an extra step because XML requires the tags to be formatted. Isn't it more efficient just to format the content as CSS?
Is XML just a fad to soon die?
If you use/used XML, I hope that you'll share your experience.
More to the point. If you are using XML--why? What has improved in your workflow? What would you miss if you were unable to use it?
I'm looking for 'real' answers and not a debate.
The basic appeal of XML is that it provides a means of transporting data in a standardized, platform independent format. But there are certainly other benefits.
In website development, it gives you a way to draw a hard line between your content and your presentation. If you work with people that understand the reason behind object programming, then this isn't that big of a deal. Unfortunately there are a LOT of people designing and coding websites that don't want to be bothered with separating content from presentation. However, tell them they need to put the content into XML and then render it with XSL, and they have no problem.
All of the websites and webservices I do are tied to a database. They exist to enter and manipulate the contents of databases. XML is a natural data transport choice for these sites. But even the login and other static pages are in XML. The layout and looks of the website then are maintained in one set of XSLT files.
Separating the content from the presentation is so important. It will reduce initial bugs, and allow you to quickly home in on the source of the ones that do slip through. When you are the sole developer, it allows you to focus on the task at hand without messing up other aspects of a page or site. When there are multiple developers, it permits you to assign work more efficiently.
(You will hear these same arguments for using CSS, which by the way is tied into your layout via the XSLT.)
If you are doing a small (10 or 20 pages) website, and you know HTML, etc, but you don't already know XML and XSL, then it is probably not worth learning it just to do that site. If you are doing a larger site, I would say that it is worth while. And if you already know XML/XSL, then it would make sense to do the small sites in it as well.
Again, everyone's situation is different. How much will the site grow? How often will it change? What are the skills available to the person/people that will be maintaining the site? and so on...
With XML, you can maintain one set of content, but quite easily present it differently based upon the device requesting the content. So the XSL transformation for delivering your content to a browser would be different than that used for delivering the same source XML to a handheld device. And you might have a third set of XSL for delivering an RSS feed.
Also, the same technique can be used for sharing the data on a remote website.
Can't CSS also be used for altering presentation for other devices?Yes, but CSS does not stand alone; it is used to style some other markup format. CSS can control the presentation of the HTML sent to a desktop web browser, but it can't change that HTML into WML for your mobile phone or LaTeX for your typesetter or NITF for your syndicator.
The "point" of XML is extensibility and interchangeability; at its core XML is a text markup language with very simple rules, making it easy to read, transmit, and convert in standard ways. It's a lot easier to, say, extract a block of FinXML data and translate it to IRML than to extract an Excel worksheet and output it as a FoxPro table.
Now comes a technical question. To use the XML file it needs to be interpreted by XLST. Correct? What is the best source for learning the basics of XLST?
Also, a search has brought up sites that recommend using javascript for presenting XML on a web page. Is there any advantage/disadvantage of javascript over XLST?
I really appreciate the feedback on these questions. The fog is beginning to lift.