Forum Moderators: open

Message Too Old, No Replies

In the defence of old browsers.

Use XML and XSLT to support ALL browsers.

         

requiem

7:29 pm on May 18, 2003 (gmt 0)

10+ Year Member



If you build websites for a living, you are probably already
very familiar with XML, XSLT, and most likely serverside programming. You probably also spend most of your time to build template driven websites. So what is the problem?

If all the website content if coded in XML, you just have to write a few different XSLT stylesheets do transform the XML into the markup most suited for different browsers.
It is to ways to do this, serverside or beforehand.

When a useragent is visiting your website, use could just
a serverside test to redirect the user to the most appropriate version of the markup, or just generate the markup on the spot. If you do it before hand you just need more diskspace, but hey diskspace is really not that expensive. If you do it serverside then it just takes a little more time to serve the page, but then again it should not be a problem either.

It does take a little more time to develop multiple XSLT stylesheets, and a few more CSS, but who is paying? The Client! Just ask the client if he wants the site to support ALL browsers? 99% of the time the client will approve the few extra hours on the bill. There is also other great benefits in using pure XML to encode documents.

Hester

9:12 am on May 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This is surely the way to go. I'm thinking of converting all my content to XML. Initially it will be converted directly to XHTML using PHP but I'd be very interested in how you can use XSLT to do what you say.

requiem

9:06 pm on May 19, 2003 (gmt 0)

10+ Year Member



Hester wrote:
"This is surely the way to go. I'm thinking of converting all my content to XML. Initially it will be converted directly to XHTML using PHP but I'd be very interested in how you can use XSLT to do what you say."

This can be done in a number of ways. I would prefere to do
it on my own workstation, and then just upload the pages to the webserver.

You could use transformation in virtually every programming language, I use java myself. If you like to do it offine, just write a program in your favorite language to read trough a directory structure with xml files, and output different html files in other directories (keeping the same structure). You would have to write a seperate XSLT document for each transformation, and a few different CSS.
For NN4 I prefere not to use any CSS at all, so the XSLT output is pure HTML 3.2, older browsers don't support tables and various tags. A good reference is:
[ftp.ics.uci.edu...]

So at the minimum you will have four XSLT documents:
1. Two that outputs XHTML, and is using CSS
2. One that outputs Html 3.2 Final, and does not use CSS
3. one that outputs html 2.0

You will have to write at the minimum two CSS:
1. One for Standard compllient browsers.
2. One for IE5, and other non standardbrowsers.

After the files are uploaded to the webserver, you would have to use serversidescripting (eg. php) or set the webserver to serve the appropriate content to the different user agents. You could even make a flash version of the site (for flash supporting browsers), and redirect robots to a different version of the site.

(I appologize for my bad english, I am dead tired)

requiem

5:02 pm on May 24, 2003 (gmt 0)

10+ Year Member



If you add a database to the mix it all gets even more easy.

aspr1n

5:14 pm on May 24, 2003 (gmt 0)

10+ Year Member



requiem, you maybe interested in this thread I started a while back: Squeezing more juice from the XML fruit [webmasterworld.com]

asp

requiem

7:41 pm on May 24, 2003 (gmt 0)

10+ Year Member



Thank you, I will be reading the thread.