'XML parse in Javascript
Trying to use an xml in javascript. The emailtest.xml needs to be taken from the same folder as emailtest.js and emailtest.html. I am not sure how to use the parser. Is there a right way to address a xml in js?
//emailtest.js
function window_open(){
parser= new DOMparser();
email = parser.parseFromString("emailtest.xml", "text/xml);
textbox1.text=email(1,1)
}
//emailtest.xml
<?xml version="1.0 encoding="UTF-8" standalone="yes">
<data-set xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<table>
<0>
<fname>John</fname>
<lname>Doe</lname>
<email>[email protected]</email>
</0>
<1>
<fname>Jane</fname>
<lname>Doe</lname>
<email>[email protected]</email>
</1>
</table>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
