Using client side XSLT transformations in the HTML5 era

前端 未结 3 1531
生来不讨喜
生来不讨喜 2020-12-20 20:42

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

相关标签:
3条回答
  • 2020-12-20 20:52

    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?
    0 讨论(0)
  • 2020-12-20 20:52

    The only way to ensure that your XML is always properly transformed is to do it server-side. There are huge differences in compatibility for current desktop browsers, and mobile ones certainly don't do much better. Also, HTML5 has nothing to do with XSLT, since XSLT is not a replacement for HTML. XSLT is capable of generating almost any format that you need, including HTML, but it is not designed to represent data like HTML or XML are.

    0 讨论(0)
  • 2020-12-20 21:09

    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.

    0 讨论(0)
提交回复
热议问题