Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jul 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Angry XML to string parsing not working in IE9

    I am debugging an existing application that is parsing an XML DOM object to string. It works in IE8, IE11 and Chrome but it does not work in IE9.

    It does recognize input[0] but it does not recognize .xml property. I have tried innerHTML but it is NULL as well. contentText only return text values of nodes but not thXML structure is below.

    "<root><source><item><description>sq</description><name>we</name><photoSource>abc.jpg</photoSource><x>0.53515625</x><y>0.16319444444444445</y></item></source></root>\r\n"

    =================
    function loadXmlIntoObject(input) {

    if (input[0].xml != undefined) {
    return input[0].xml;
    }
    else {
    return input[0].childNodes[0].innerHTML;
    }

    }

    =============

    any way to parse XML to string in IE9. Please provide a working solution.

  • #2
    New Coder
    Join Date
    Aug 2014
    Posts
    27
    Thanks
    0
    Thanked 1 Time in 1 Post
    The following code fragment parses an string into an XML DOM object:
    txt="<bookstore><book>";
    txt=txt+"<title>Everyday Italian</title>";
    txt=txt+"<author>Giada De Laurentiis</author>";
    txt=txt+"<year>2005</year>";
    txt=txt+"</book></bookstore>";

    if (window.DOMParser)
    {
    parser=new DOMParser();
    xmlDoc=parser.parseFromString(txt,"text/xml");
    }
    else // Internet Explorer
    {
    xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
    xmlDoc.async=false;
    xmlDoc.loadXML(txt);
    }


  •  

    Tags for this Thread

    Posting Permissions

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