jQuery Development

At DAER Systems we are huge proponents of jQuery. This open-source javascript library is top class in terms of performance and functionality and is easily extended to provide user-rich features to your site.

XML/XSL Transform Form Watermark Closable Tabs Server Validation

Transform

The transform class is a plugin for jQuery which provides an easy way for users to perform cross-browser XML transformations with XSL. It lets you retrieve and transform your xml and xsl data through a number of formats including passing the data as a url, string, and xml or ajax object and has all the features of a normal ajax request including success, error, and complete callbacks.

Features

  • Asynchronous or non-asynchronous calls
  • Multiple asynchronous transformations at once
  • Pass an object or html for a loading message while xml and xsl is retrieved
  • Automatically transform element by providing a custom transform attribute to the element
  • Supports passing ajax objects for xml and xsl retrieval
  • Request data from URL or pass as string
  • Works with xsl:import and xsl:include (even Safari and Chrome)
  • Pass custom parameter values to XSL and callback functions
  • Custom handlers for 'success', 'error', and 'complete'
  • Non-asynchronous calls return transformed HTML
  • Option to append XML and XSL as a data island
  • Works with selectors
  • No ActiveX objects
  • Tested in IE6/8, Firefox3, Opera 9, Safari 3, Chrome, Netscape 8, and Flock

Versions

Client-side - The client-side version supports basic features in all current browsers. It does not support xsl:import and xsl:include when using Chrome, Safari, or Opera.
Server-side - Our solution to the client-side issues. Using this will transform your data on the server instead of client and the xml and xsl are still requested in the browser to utilize any browser authentication. This version requires setting some values in the $.transform_config object.
You currently must set two values in the $.transform_config object:

sitetoserver - A relative path from the current page to your server-side asp/php file.
jstosite - A relative path from the javascript file to your site.

Demo

An example of the client and server-side transform class can be viewed here.

Questions/Comments

Any questions/comments about the plugin can be sent to info@daersystems.com

Documentation

All properties below can be passed in the transform config object.

Param Type Default Purpose Req?
el element null The element which the transformation html is placed. Automatically set if using $(”[selector]“).transform. N
cache bool false Used in the ajax request for xml and xsl. Does not cache result. N
async bool true Make ajax calls async or not. If false, transform function returns html. N
error function null Function to call if transform fails. Passes html,xsl,xml,transform object,and exception as arguments. Not called if ajax request fails. N
success function null Function to call if transform succeeds. Passes html,xsl,xml and transform object as arguments. N
complete function null Function to call after transform. Fires after success and even if there is an error. Passes html,xsl,xml,and transform object as arguments. N
island bool false Appends a hidden div with an xml node inside N
pass object / string null Allows you to pass additional variables,etc which will be passed to the callback functions in the obj argument. N
msg string null HTML to load to el element while performing transformation. N
element null Loads element HTML to el element while performing transformation. N
xslParams object null Object with {name:value} pairs that will add the value to the xsl:param with the respective name. N
xmlstr string null XML data as a string. Required if xml and xmlobj are not used. Y/N
xslstr string null XSL data as a string. Required if xsl and xslobj are not used. Y/N
xmlobj XML document null XML document object used for the transform Y/N
xslobj XML document null XSL as an XML document object used for the transformation Y/N
xml string null URL to xml file. Required if xmlstr and xmlobj not used. Y/N
object null Ajax object. Can be used to set custom Ajax callbacks, post, etc. Required if xmlstr and xmlobj are not used. Y/N
xsl string null URL to xsl file. Required if xslstr and xslobj are not used. Y/N
object null Ajax object. Can be used to set custom Ajax callbacks, post, etc. Required if xslstr and xslobj are not used. Y/N
dataType string html Return type for transformation result. Can be “json” or “xml”. N

Download

The latest version of the transform plugin can be downloaded here