CriticalError
New Member
i have XML file like this\[code\]<?xml version="1.0" encoding="ISO-8859-1"?><childrens> <child id="1" value="http://stackoverflow.com/questions/14537013/Root Catalog" parent_id="0"> <child id="2" value="http://stackoverflow.com/questions/14537013/Apparel" parent_id="1"> <child id="4" value="http://stackoverflow.com/questions/14537013/Shirts" parent_id="2"/> <child id="5" value="http://stackoverflow.com/questions/14537013/Pants" parent_id="2"/> </child> <child id="3" value="http://stackoverflow.com/questions/14537013/Accessories" parent_id="1"> <child id="6" value="http://stackoverflow.com/questions/14537013/Handbags" parent_id="3"/> <child id="7" value="http://stackoverflow.com/questions/14537013/Jewelry" parent_id="3"/> </child> . . . <child id='bla bla'> <child id='bla bla'> <child id="1005" value="http://stackoverflow.com/questions/14537013/test1" parent_is="1111"/> <child id="1006" value="http://stackoverflow.com/questions/14537013/test12" parent_is="1111"/> <child id="1007" value="http://stackoverflow.com/questions/14537013/test123" parent_is="1111"/> <child> </child> <child ></childrens>\[/code\]i have written this jQuery code to get the leaf element(which has no child) for example here leaf node is which have id 4,5,6,7,1005,1006 and 1007\[code\]$.ajax({ type: "GET", url: "test.xml", dataType: "xml", success: function(xml) { $(xml).find('child').children().each(function(){ var id = $(this).attr('entity_id'); alert(id) }); }});\[/code\]it is not working