locked
Parsing XML is not working other than IE !!! RRS feed

  • Question

  • Hey guys..

             I'm trying to parse XML which is working fine with ActiveXobjects  in IE , how can i make it work in otherbrowser.. and also 2013 is just around the corner i want to make this code future proof ...

    so.. here is  my code..

    function RevokeUserAccess(responseXML) {
    
                var sFetchResult = responseXML.xml;
                var resultDoc = new ActiveXObject("Microsoft.XMLDOM");
                resultDoc.async = false;
                resultDoc.loadXML(sFetchResult);
    
                var results = resultDoc.getElementsByTagName('a:Id');
    
                for (var i = 0; i < results.length; i++) {
                    var userGUID = results[i].text;
                     
                    // business logic goes here.... 
    
        }
    
    }

    I found alternative for cross browser compatibility but it's not seem to be working for me..  

     var sFetchResult = responseXML.selectSingleNode("//a:Id");
     var resultDoc = sFetchResult.selectNodes("a:Id");
     
    //parse result xml into array of jsDynamicEntity objects
     var results = new Array(resultDoc.length);
     for (var i = 0; i < resultDoc.length; i++) {
     var oResultNode = resultDoc[i];

    Thanks

          
    • Edited by Pradeep47 Friday, September 6, 2013 5:08 AM
    Friday, September 6, 2013 5:04 AM

All replies