Hi. I need a little direction on how to parse this in JavaScript.
I want to list the total number of buildings and in each building, the total number of tenants.
My XML looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<AppManager-response uri="/AppManager/xml/ListBuildings">
<result>
<response method="ListBuildings">
<Building Name="Broadway Business Center" TYPE="Commercial">
<Tenant DISPLAYNAME="ABC Company" TYPE="Owner"/>
<Tenant DISPLAYNAME="123 Company" TYPE="Renter"/>
</Building>
<Building Name="Seniors Residence" TYPE="Private">
<Tenant DISPLAYNAME="Ricky Ricardo" TYPE="Owner"/>
<Tenant DISPLAYNAME="Bob Barker" TYPE="Owner"/>
<Tenant DISPLAYNAME="Tony Randal" TYPE="Renter"/>
</Building>
</response>
</result>
</AppManager-response>
I've been playing around with the examples at w3schools XML DOM traverse Node tree - but it's not working for me.
Sorry, I'm just a newbie in this.