Transform plugin
The Transform plugin enables users to easily make cross-browser XML transformations with XSL. The plugin does not rely on additional libraries and utilizes all ajax options. Very flexible and easy to use.
Transform features include:
- Asynchronous or non-asynchronous calls
- Multiple asynchronous transformations at once
- Pass an object or html for a loading message
- Automatically transform by providing a custom transform attribute to the element
- Now supports all ajax options such as beforeSend
- Request data from URL or pass as string
- Works with xsl:import and xsl:include
- 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
- No web server required. An unintentional result, but most features run from the desktop
- Tested in IE6+, Firefox2+, Opera 9, Safari 3, Netscape 8, and Flock
Examples: - More available in download
//Simple request for element with id="result"
$("#result").transform({xml:"file.xml",xsl:"file.xsl"});
-or-
$.transform({el:"#result",xml:"file.xml",xsl:"file.xsl"});
//With XSL parameter
$("#result").transform({
xslParams:{name:"value"},
xml:"file.xml",xsl:"file.xsl"
});
//Non-async returns HTML
var html = $.transform({async:false,xml:"file.xml",xsl:"file.xsl"});
//Custom handlers
$("#result").transform({
success:someFunc,error:someFunc,complete:someFunc,
xml:"file.xml",xsl:"file.xsl"
});
//Pass XML and XSL as string
$("#result").transform({xslstr:[xsl string], xmlstr:[xml string]});
//Use transform attribute to transform on load with msg
<div transform='{xml:"file.xml",xsl:"file.xsl",msg:$("#loadingmsg")}'></div>
//Request xml from web service by using an ajax object for the xml instead of file name
$("#result").transform({
xml:{
url:"service.asmx/AddTogether",
data:{
y:$("#y").val(),
x:$("#x").val()
},
type:"POST",
dataType:"xml"
},
xsl:"xsl/service.xsl"
});
$("#result").transform({xml:"file.xml",xsl:"file.xsl"});
-or-
$.transform({el:"#result",xml:"file.xml",xsl:"file.xsl"});
//With XSL parameter
$("#result").transform({
xslParams:{name:"value"},
xml:"file.xml",xsl:"file.xsl"
});
//Non-async returns HTML
var html = $.transform({async:false,xml:"file.xml",xsl:"file.xsl"});
//Custom handlers
$("#result").transform({
success:someFunc,error:someFunc,complete:someFunc,
xml:"file.xml",xsl:"file.xsl"
});
//Pass XML and XSL as string
$("#result").transform({xslstr:[xsl string], xmlstr:[xml string]});
//Use transform attribute to transform on load with msg
<div transform='{xml:"file.xml",xsl:"file.xsl",msg:$("#loadingmsg")}'></div>
//Request xml from web service by using an ajax object for the xml instead of file name
$("#result").transform({
xml:{
url:"service.asmx/AddTogether",
data:{
y:$("#y").val(),
x:$("#x").val()
},
type:"POST",
dataType:"xml"
},
xsl:"xsl/service.xsl"
});
Post your thoughts:
Any thoughts on the plugin are greatly appreciated. You can post them here
评论
Transform视频编码
Transform是Facebook开源的一个视频过滤器,可以把360度全景视频转换成“立方体贴图”,可以有效的降低文件大小,最多可以降低25%。
Transform视频编码
0
Flip Transform View
实现类似Flipboard那种折页(从上往下、从左往右折叠)更新效果。可用于页面切换、图片切换、电子书翻书、以及计时(秒表变化)效果。[Code4App.com]
Flip Transform View
0
HoverPulse Plugin
HoverPulsePlugin是一个jQuery插件,用来实现鼠标移到小图上看大图的功能。在线演示:http://jquery.malsup.com/hoverpulse/示例代码:$(docume
HoverPulse Plugin
0
OpenFlashChart Plugin
OpenFlashChartPlugin是Grails环境下的OpenFlashChart插件。安装方法:grailsinstall-pluginofchart
OpenFlashChart Plugin
0
Media Plugin
Unobtrusivelyconvertselementsintorichmediacontent.SupportedMediaPlayers:-Flash-Quicktime-RealPlayer-
Media Plugin
0