OK this is some progress. Still want more abstraction where I can,
though this is much improved. I also need to be able to get arrays of
attributes abstractly.

  function parseXml(xml) {
                $(xml).find('sites').each(function(){
                var PARENTarr = jQuery.makeArray($(this).find('>element'));
                var CHILDarr = jQuery.makeArray($(PARENTarr).find('>element'));
                        $.each(PARENTarr, function(i){
                                                var PfromA = $(this);
                                                var Pid = 
$(this).attr("label")+$(this).attr("id");
                                                var Cid = 
$(CHILDarr[i]).attr("label");
                                                $("div").append("<br/>"+Pid 
+"<br/>" + Cid +"<br/>");
                                                $(CHILDarr[i]).each(function(){
                                                        var CHILDattrs = 
jQuery.makeArray($(this).find('>element'));
                                                        
$(CHILDattrs).each(function(){
                                                                  var CHILDid = 
$(this).attr('label') +": "+ $(this).text();
                                                                  
$("div").append(CHILDid +"<br/>");
                                                          });
                                                });
                          });
                  });
        }
});

Reply via email to