Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using client side XSLT transformations in the HTML5 era

Can anyone help regarding the availability of client-side XSLT in mobile HTML5 browsers? caniuse.com has nothing on it.

Is XSLT actually standardized across current mobile browsers?

The HTML5 spec has nothing on XSLT which puts into question whether XML has a future (in light of the fact that there is JSONP but there is no "XMLP")

like image 270
Peter Aron Zentai Avatar asked Mar 23 '12 22:03

Peter Aron Zentai


2 Answers

Availability of XSLT 1.0 client-side is now pretty universal in modern browsers, with the exception of some mobile platforms; and the level of conformance is also quite reasonable (probably rather better than Javascript/DOM). We've been using client-side XSLT for the Saxonica web site for some months and there are very few reports of problems, though we do have a fall-back site that's static HTML, which we redirect to when we detect that XSLT isn't supported.

The recently open-sourced Saxon-CE now delivers XSLT 2.0 on any browser with Javascript support. It does a lot more than upgrade the XSLT support to XSLT 2.0; it also provides a declarative way of handling user input in the browser and creating interactive applications.

It's true of course that the browser vendors have largely lost interest in XML. The same isn't true of content publishers, so it's up to third parties to fill the gap.

like image 120
Michael Kay Avatar answered Nov 19 '22 04:11

Michael Kay


The XSLTProcessor API is part of the HTML5 scripting spec:

  • Interaction of script elements and XSLT

When an XSLT transformation program is triggered by an processing instruction and the browser implements a direct-to-DOM transformation, script elements created by the XSLT processor need to be marked "parser-inserted" and run in document order (modulo scripts marked defer or async), immediately, as the transformation is occurring.

The Safari Web Content Guide says:

XSLT is supported in iOS 2.0 and later.

Android 2.2.x(Level 8) added Java APIs for XSLT, accessible client-side via the XSLTProcessor API of JavaScript.

Android 4.0 supports XSLT processing instructions, according to answers to the following question:

  • Is the Android Browser capable of performing an xsl transform?
like image 40
Paul Sweatte Avatar answered Nov 19 '22 05:11

Paul Sweatte