Click to See Complete Forum and Search --> : Client-Side XSLT Issues?


Elamar
12-07-2008, 07:49 PM
I've been looking into using xslt for a project I'm working on (solely to separate the code from the design, but without having to waste the resources to do templating server-side), and honestly, it seems almost too good to be true.

It seems _perfect_ for what I need, and it seems like it'd see more use, (I had barely heard of it before today :/ ) which is making me wonder if there's some horrible incompatibility going on, or some other major flaw with doing xml transformations client-side?

The only bits of discussion I could find on the subject are from 6-8 years ago, so I dunno if they still hold today :|

Thanks,
Elamar

rpgfan3233
12-08-2008, 03:03 AM
The major flaw is the fact that not all computers are as fast as your own. If you use client-side XSLT, three things happen:
The browser downloads the XML document and checks it for well-formedness The browser downloads the XSLT document and checks it for well-formedness and validity The browser applies the XSLT document to the XML document

In addition, if your site is designed to be a sort of help site or troubleshooting site or whatever, and someone only has access to a text browser... Well, I don't know of any text browsers that can handle XSLT.

Applying the XSLT document server-side is much better because the server removes the variable of a user's machine speed and eliminates the problem of text browsers. All the browser has to do then is parse the resulting X/HTML document. In addition, a server is usually faster than someone's machine.

Of course, that depends on whether or not your server-side language of choice can handle XSLT.

Alain COUTHURES
12-09-2008, 04:15 AM
XSLT support in standard browsers (not Konqueror...) is almost perfect but there are still some surprising bugs or lacks, even with FireFox.

I'm using XSLT to transform XForms to XHTML+AJAX (http://www.agencexml.com/xsltforms/ (http://www.agencexml.com/xsltforms)) and there is not really a time problem even if it is a complex transformation (XPath expression analysis...).