Let's Go!
Objective
Perform a successful Cross-Browser Client-Side Transformation and Rendering of a XML file through a HTML or XHTML web page using Dynamic XSLT.
- Normally, when you double-click on a XML file with a XSLT stysheet linked to it, it will open and render in your default browser.
- However, if you use a (X)HTML web page to call the XML file with its linked XSLT stylesheet, you need an interface that instructs the XSLT Processor for that browser to render the page correctly.
- Dynamic XSLT uses DOM/JavaScript as this interface to enable the cross-browser client-side transformation and rendering of a XML file in a (X)HTML web page.
- Microsoft and Mozilla browsers use different XSLT processors (Microsoft uses MSXML for Internet Explorer and the Mozilla family uses TransforMiiX) to perform client-side (browser) transformations of XML files.
- The DOM/JavaScript recognizes which browser the (X)HTML web page is going to be rendered in.
- It then identifies and instructs the correct XSLT Processer to do the transformation of the XML file into a rendered (X)HTML web page, depending on the browser being used.
- This enables us to perform equal XSLT cross-browser transformation and rendering of XML files into (X)HTML web pages in Microsoft and Mozilla browsers.
Try it:
- To view a cross-browser XSLT Client-Side Transformation, open the project folder and double-click the Example.htm file.
- If you are on a Windows operating system it will open in your default browser, Microsoft Internet Explorer.
- Next, if you have Mozilla, Firfox or Netscape installed on your local computer, right-click on the Example.htm file and choose Open with one of these
browsers.
- Each browser will open and render the Example.htm web page properly.
- This demonstrates the "Dynamic XSLT" rendering of a XML file into a (X)HTML web page.
Sarissa ECMAScript Library v.0.9.6.1
One of the keys to successful cross-browser xslt transformation is the Sarissa ECMAScript Library v.0.9.6.1.
The sarissa.js file (contained in the Library) enables you to effect the complete xslt transformation of a xml file in IE, Firefox, Netscape and Mozilla browsers. As defined by SourceForge.net: "Sarissa is a cross-browser ECMAScript library for client side XML manipulation, including loading XML from URLs or strings, performing XSLT transformations, XPath queries and more. Supported: Gecko (Mozilla, Firefox etc), IE, KHTML (Konqueror, Safari)".
- Project Admins: mbatsis
- Operating System: OS Independent (Written in an interpreted language)
- License: Apache License V2.0, GNU General Public License (GPL), GNU Library or Lesser General Public License (LGPL)
- Category: Browsers, Dynamic Content, Software Development