Does anyone have any javascript code using Microsoft XMLDOM that converts XML to javascript object?
Ex:
This XML
<customer>
<header>
<date>Oct 23, 2000</date>
<time>11:00:00</time>
</header>
<body>
<ssn>333445555</ssn>
<email>
<type>POP</type>
<address>joe.smth.T@NSDK.COM</address>
</email>
</body>
<footer>
<total>6</total>
</footer>
</customer>
will become 1 javascript object w/ childs that may have childs
customer.header.date
customer.header.time
customer.body.ssn
customer.body.email.type
customer.body.email.address
customer.footer.total
with the proper values contained in the variables. Also another requirement would be that the code is not dependent on the number of levels (how deep it gets). Seems like a recursive function call to me.. but I just don't know how to write it.
Thanks much!
g00ber
Ex:
This XML
<customer>
<header>
<date>Oct 23, 2000</date>
<time>11:00:00</time>
</header>
<body>
<ssn>333445555</ssn>
<email>
<type>POP</type>
<address>joe.smth.T@NSDK.COM</address>
</email>
</body>
<footer>
<total>6</total>
</footer>
</customer>
will become 1 javascript object w/ childs that may have childs
customer.header.date
customer.header.time
customer.body.ssn
customer.body.email.type
customer.body.email.address
customer.footer.total
with the proper values contained in the variables. Also another requirement would be that the code is not dependent on the number of levels (how deep it gets). Seems like a recursive function call to me.. but I just don't know how to write it.
Thanks much!
g00ber