Answers for "javascript parse xml"

1

javascript parse xml

const txt = "<address> <street>Roble Ave</street> <mtfcc>S1400</mtfcc> </address>"

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);
}
Posted by: Guest on August-13-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language