Skip to content

Fast in-browser xml to json conversion when json just isnt available. Works in all browsers

Notifications You must be signed in to change notification settings

thatcher/jquery-xslt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jquery-xslt;

jquery-xslt is a jquery-jspath plugin that provides cross browser xslt implementation
(based on based on jquery.xslt.js by johann burkard). it is designed to provide
a super fast way of transforming xml to js on the client, though it could be used
for many additional purposes.

how about a useful example before i loose interest

ok how about this one


// This is our example plugin that will be created.
// it will be called _.evalx because of the first
// param, will use eval.xsl, and then pass the result 
// to the optional callback provided as the third param

$.xslt('evalx', 'eval.xsl', {
	force_array : "|hit|location|list|term|target|"
}, function(result){
	var doc,
		json = (typeof(result)=='string')?result:$(result).text();
		doc = eval( "(" + json + ")" );
	return doc;
});

var js;
$.ajax({
	type:'GET',
	url:'test/data/test-js.xml',
	dataType:'xml',
	success:function(xml){
		
		// This is a super-fast way to convert 
		// xml to javascript! in any browser!	
	    js = $.evalx(xml);
	    
	}
});

nice!

ready for more?
checkout the example.html!

also check out these
jquery-jspath plugins:

qlso please check out the spec for each plugin (test/test.html). special thanks to aaron quint for the
jqunit-spec plugin that all of these plugins use!

About

Fast in-browser xml to json conversion when json just isnt available. Works in all browsers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published