I have following XML file
<node title="Home" controller="Home" action="Index">
<node title="Product Listing" controller="Listing" action="Index" >
<node title="Product Detail" controller="Ad" action="Detail" />
</node>
<node title="About Us" controller="AboutUs" action="Index" />
<node title="Contact Us" controller="Contact Us" action="Index" />
<node title="Place Your Order" controller="Order" action="Index" >
<node title="Order Placed" controller="Placed" action="Index" />
</node>
<node title="FAQ" controller="FAQ" action="Index" />
</node>
i want to parse these element in following formats
Home > Product Listing > Product Detail
Home > Place Your Order > Order Placed
Home > Contact Us
Home > FAQ
Home > About Us
I have tried to do this but it cannot give hierarchical iteration.
function GetChildNode1(xml) {
$(xml).find('node').each(function (i) {
nodeArray.push($(this).attr('title'));
GetChildNode($(xml).find('node').eq(i));
});
}
How can i do this . is this correct format of xml to get following output