FireFox Problem

S

shidhincr

I have some doubts regarding XML and XSL transfornation using
javascript.Hope SomeOne will help me for solving this problem.

Actually i Created a javascript for transforming XML and XSL. i made
a new class in the javascript and i added the object of that
particular class and a namespace into the processor by using the
method processor.addObject(object,namespace) . It works fine in
Internet Explorer. So that i could call a function of that object in
my xsl file xpath. the code for Internet Explorer is given below for
reference.

My problem is that when i come to FireFox or any Mozilla Browser, i am
not able to add an object into the XSLT processor of mozilla. So i
cant call any external functions inside my xsl file xpath. Could
anyone please help for doing the same. or any other techniques for
calling an external function in the xpath of the xsl file.(for
mozilla).
I will be very grateful to you.

Javascript for Internet Explorer :

/* xml-xsl-transformation-IE.js */

/
*---------------------------------------------------------------------------------
*/

function MyClass()
{
this.multiply=multiplyNow;

function multiplyNow(val1,val2)
{
var val3=val1*val2;
return val3;
}
}
function parseFiles()
{
try
{
var elemTbl=document.getElementById("tblId");
var xmlIE=new ActiveXObject("Microsoft.XMLDOM");
var xslIE=new ActiveXObject("MSXML.FreeThreadedDOMDocument");

//Load the Script Synchronous with the page
xmlIE.async = false;
xmlIE.load("xml_js.xml");

xslIE.async = false;
xslIE.load("xsl_js.xsl");

var FnObj=new MyClass();


var xslTemplate=new ActiveXObject("Msxml2.XSLTemplate");
xslTemplate.stylesheet=xslIE;
var Processor=xslTemplate.createProcessor;

Processor.input=xmlIE;
Processor.addObject(FnObj, "urn:my-java-function" );

Processor.transform();
//var docIE=xmlIE.transformNode(xslIE);
elemTbl.innerHTML=Processor.output;
}
catch(f){alert(f.message)}


}
/
*---------------------------------------------------------------------------------
*/

Thanking You

Shidhin.C.R
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,077
Latest member
SangMoor21

Latest Threads

Top