var JXSLTProcessor = Class.create();
JXSLTProcessor.prototype = {
	initialize: function(options) {
		Object.extend(this, options);
		this.transform();		
	},
	transform: function() {
		if(!this.aXSL || !this.aXML) return;
		this.xsl = this.getXML(this.aXSL);
		this.xml = this.getXML(this.aXML);
		this.transformer[Prototype.Browser.IE ? "IE" : "OTHERS"].call(this); 
	},
	getXML: function(file) {
		var xmlDoc = Prototype.Browser.IE ? new ActiveXObject("Microsoft.XMLDOM") :
			document.implementation.createDocument("", "", null);
		xmlDoc.async = false;
		xmlDoc.load(file);
		return xmlDoc;
	},
	transformer : {
		IE : function() {
			var dummy = document.createElement("div");
			dummy.innerHTML = this.xml.transformNode(this.xsl); 
			this.result = dummy;
		},
		OTHERS : function() {
			var xsltProcessor = new XSLTProcessor();
			xsltProcessor.importStylesheet(this.xsl);
			var dummy = document.createElement("div");
			dummy.appendChild(xsltProcessor.transformToFragment(this.xml, document));
			this.result = dummy;
		}
	}	
};
