Page 1 of 1

Web pages formed on Browser (XML + XSLT)

Posted: Tue May 10, 2011 7:12 pm
by MikeGale
In the past I have seen web site developers using the combination of XML + XSLT to create pages using the transform engine in a browser.

I didn't buy into the idea back then. (I can't even remember any testing I might have done.)

I was looking at the idea again yesterday. A couple of questions came to me. I'd appreciate insights.
  • 1) If anybody here uses that technique can you give some insight from a developer viewpoint?
  • 2) How do you test? (CSE doesn't test the XML in the usual way. It falls back onto nsgmls. Not sure if that renders it before parsing!)

Re: Web pages formed on Browser (XML + XSLT)

Posted: Tue May 10, 2011 8:08 pm
by Albert Wiersch
I'd be interested in this too. I am not aware of anyone who does this and I would think something like this would be very problematic for public sites accessed by various browsers.

Re: Web pages formed on Browser (XML + XSLT)

Posted: Tue May 10, 2011 9:31 pm
by MikeGale
I once saw some pretty smart guys doing things this way. I didn't discuss it with them so I don't know how much they tested and whether it endured.

The modern browsers mostly seem to support it. Many of the engines (Web Kit, Trident and Gecko) support the technique. It seems that KHTML doesn't which may not be important and it seems that Presto may get some things wrong (don't know what), so Opera might force simplified XSLT. With IE/Trident there might be a variety of XML engines MSXML2/3/4... for the same browser version.

My untested and unresearched supposition is that in 2001 it was hard to do but that today, ten years later, it may well be workable. (Provided that your XSLT is compatible back to earlier versions of MSXML if you want to support IE6. Though I wouldn't be surprised if most living copies of IE6 are beyond MSXML2.)

If there's a way of going beyond defining the transform inside the XML (kinda hard coded), it has some real possibilities. (I haven't checked whether that can now be done!) You could render very differently from the same source without producing a different page for each version!

Testing is an issue. You want to test the actual DOM present in the browser, not the components from which it is constructed.

EDIT: To correct details of HTML rendering engines that support the technique, see Presto and KHTML.

EDIT 2, NOTE: KHTML is used in the Konqueror browser. I checked several years of log files (millions of server requests) for an internationally used site. Konqueror appeared twice. Once possibly as a browser (2 requests, which rules it out as a normal browser, maybe it was a robot) the other seemingly as part of a robot (2 requests). On that basis KHTML may not be important for many web sites.

EDIT 3, NOTE 2: Opera from Presto version 2.1 (at least) claims to support XML + XSLT. I tested an Opera 11 instance against a very simple XML + XSLT page. It worked.

EDIT 4, NOTE 3: I decided to dig a bit deeper. For run of web content at least one user has developed a sophisticated handling system to avoid browser problems. Details at I imagine many publishers will find that intimidating. The article is 5 years old, so the current situation may be better. For more detail on some issues Ivan Pepelnjak
has information at Subject to better information coming in, I'll not pursue this at present.