[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Parameters to XSL from Javascript

Subject: Parameters to XSL from Javascript
From: Robert G <nyjets3422@xxxxxxxxx>
Date: Fri, 15 May 2009 10:36:17 -0700 (PDT)
 Parameters to XSL from Javascript
Hi,
      I have been working on getting my XSL to be generated through javascript and I got it to work for firefox and IE. But the problem is I was able to pass a parameter for the firefox section but not the IE. I looked up how to do it for IE but it doesn't seem to work. Please let me know if you see any problems with it. Heres my code....

function loadXMLDoc(fname)
{
  var xmlDoc;
  // code for IE
  if (window.ActiveXObject)
  {
    xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
  }
  // code for Mozilla, Firefox, Opera, etc.
  else if (document.implementation
  && document.implementation.createDocument)
  {
    xmlDoc=document.implementation.createDocument("","",null);
   }
  else
  {
    alert('Your browser cannot handle this script');
  }
xmlDoc.async=false;
xmlDoc.load(fname);
return(xmlDoc);
}

function displayResult()
{

xml=loadXMLDoc("test.xml");
xsl=loadXMLDoc("test.xsl");
// code for IE

if (window.ActiveXObject)
  {
        var xsltCompiled = new ActiveXObject("Microsoft.XMLDOM");
        xsltCompiled.stylesheet = xsl.documentElement;

        var xsltProc = xsltCompiled.createProcessor();

        xsltProc.input = xml;
        xsltProc.addParameter('item',itm);
                                                                            
        xsltProc.transform();
}

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.