Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Applying CSS to client-side transformed pages [Thread Next] Re: Applying CSS to client-side transformed pagesTo: NULL Date: 4/2/2006 1:20:00 PM Simon Brooke wrote: > I've been doing XSL transforms, converting XML to HTML, server side since > 2000. In those days, clients which could do the transformation client > side didn't exist, so whether to transform client-side or server-side > wasn't an issue. > > Recently I've been overhauling the code in order to pass transform to the > client wherever possible, and I've hit two problems Right. Client-side XML isn't worth it unless you can control the browser version. For some unexplained reason, browser-makers simply haven't put any effort into fixing client-side transformation yet. > (i) How do I know whether the client can do transforms? Currently I'm > only passing the transform to the client if the client sends an > 'Accepts' header which contains either 'application/xml' or > 'text/xml'. However, Internet Explorer 6, which apparently can do > transforms client side, doesn't send either of these. See http://xml.silmaril.ie/users/browsers/ > (ii) When the transforms transform XML to HTML which includes a link to a > CSS stylesheet, the visual appearance (in Firefox, anyway) which > results from a client-side transform is quite different from that > which results from a server-side transform, and it appears that the > CSS styling is being applied before the XSL transform is complete. That sounds unlikely. XSLT transformation undergoes serialisation only as the last stage (in the applications I have seen) so it ought to apply CSS only once the output HTML hits the browser's parser. But I guess it's possible that it works differently internally -- yet another reason why client-side transformation simply isn't worth it yet. > How can I ensure that the CSS is applied to the completed page? You can't. IE is hopelessly broken. Firefox is better, but still incomplete. Opera is slightly better still, but all three do a number of things differently, and some of them are just plain wrong. ///Peter -- XML FAQ: http://xml.silmaril.ie/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
