XML transformation in mozilla - Mozilla

This is a discussion on XML transformation in mozilla - Mozilla ; 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 ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: XML transformation in mozilla

  1. XML transformation in mozilla

    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. 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..

    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

  2. Re: XML transformation in mozilla

    shidhincr@gmail.com wrote:
    > 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. 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..


    You might take a look at
    https://bugzilla.mozilla.org/show_bug.cgi?id=391177

    John.

+ Reply to Thread