Forum Moderators: phranque

Message Too Old, No Replies

Why use XML

         

Storyman

3:47 pm on Jun 27, 2006 (gmt 0)

10+ Year Member



Will someone explain what advantages/disadvatages there are to using XML. All of the sites that extoll XML praise the pros, but not a word about the cons.

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.

choster

4:28 pm on Jun 27, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It depends what you are using XML for. It is well-suited to, say, web services, but not for, say, data storage. As a technology it can hardly be called a fad, as it's been around for about a decade now.

Storyman

4:52 pm on Jun 27, 2006 (gmt 0)

10+ Year Member



Okay, I get it isn't for data storage and that it is for web services. It might be around for several more decades and like Elvis there will the random sighting to suggest it isn't dead.

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.

john_k

4:52 pm on Jun 27, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



As Choster said - XML isn't for every application.

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...

john_k

4:58 pm on Jun 27, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



One other topic I forgot to bring up... Developing your content for multiple presentation devices.

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.

syber

5:01 pm on Jun 27, 2006 (gmt 0)

10+ Year Member



XML is ideal for persisting data on a website. Rather than hitting the database every time someone accesses a data-driven page, you can represent the data as XML and refresh it only when the data changes. This can greatly improve the speed of the affected pages.

Also, the same technique can be used for sharing the data on a remote website.

Storyman

5:15 pm on Jun 27, 2006 (gmt 0)

10+ Year Member



It's starting to make sense when devices, i.e. mobile devices, are introduced into the equation and database efficiency.

Question: Can't CSS also be used for altering presentation for other devices?

choster

5:51 pm on Jun 27, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



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.

Storyman

6:19 pm on Jun 27, 2006 (gmt 0)

10+ Year Member



Tell me if I've got this right. Let's say I'm using Adobe's inDesign to layout an ebook, then export it as an XML (with all element tags redifined). I can then use that XML file in either Dreamweaver/GoLive for the content of a web site.

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.

Mistra

9:52 pm on Jun 27, 2006 (gmt 0)

10+ Year Member



I use XML for Google Sitemap - very important for SEO.

Other than that for Ajax and RSS news feed. If the data is stored in HTML format there is a limit to the way it could be presented.

txbakers

2:39 am on Jun 28, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Can anyone recommend good tutorials for storing Data in XML for easy access? I'd like to try some of that myself.

henry0

1:33 pm on Jul 1, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you use HTML, CSS,PHP and MySQL in a combo
Does XML brings in any benefits?
(Instead of HTML)