SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Aug 2003
    Location
    Vancouver, WA
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Loading XML client-side with JavaScript using Netscape?

    Hello,

    I cannot figure out how to load XML client-side with JavaScript using Netscape.

    This loads XML client-side with IE
    Code:
    // Load XML 
    var xml = new ActiveXObject("Microsoft.XMLDOM")
    xml.async = false
    xml.load("clients.xml")
    
    // Load XSL
    var xsl = new ActiveXObject("Microsoft.XMLDOM")
    xsl.async = false
    xsl.load("clients.xsl")
    
    // Transform
    document.write(xml.transformNode(xsl))
    This is what I have tried already to load XML client-side with Netscape
    Code:
    var xslStylesheet;
    var xsltProcessor = new XSLTProcessor();
    var myDOM;
    var xmlDoc;
    
      // load the xslt file
      var myXMLHTTPRequest = new XMLHttpRequest();
      myXMLHTTPRequest.open("GET", "clients.xsl", false);
      myXMLHTTPRequest.send(null);
    
      xslStylesheet = myXMLHTTPRequest.responseXML;
      xsltProcessor.importStylesheet(xslStylesheet);
    
      // load the xml file
      myXMLHTTPRequest = new XMLHttpRequest();
      myXMLHTTPRequest.open("GET", "clients.xml", false);
      myXMLHTTPRequest.send(null);
    
      xmlDoc = myXMLHTTPRequest.responseXML;
    
      var fragment = xsltProcessor.transformToFragment(xmlDoc, document);
    
      document.getElementById("example").innerHTML = "";
    
      myDOM = fragment;
      document.getElementById("example").appendChild(fragment);
    That way did not work to load XML client-side using Netscape.

    Please help.

    -Flint

  2. #2
    Sultan of Ping jofa's Avatar
    Join Date
    Mar 2002
    Location
    SvÝ■jˇ­
    Posts
    4,080
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Netscape version 7.1 or later?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •