By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,970 Members | 1,668 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,970 IT Pros & Developers. It's quick & easy.

FireFox Problem

P: n/a
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
Jun 27 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
This is a good place to start for how to do XSLT in FireFox

http://developer.mozilla.org/en/docs.../XSLT_Bindings

Also, AKAIK, XSLT in FireFox does not allow you to create extension
functions (in JavaScript).

Justin Johansson

sh*******@gmail.com wrote:
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 :
<cut/>

Thanking You

Shidhin.C.R
Jun 27 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.