I was wondering if anyone had an alternative to this.
$(xml).find("a").each(function(){
$(this).find('b').each(function(){
$(this).find('c').each(function(){
$(this).find('d1').each(function(){
sectionValidation.RegisterTerms.setRegisterTermsArray(this);
});
$(this).find('d2').each(function(){
sectionValidation.RegisterTerms.checkValidVariations(this, val);
});
});
});
});
It seems really bloated and there has to be a more elegant approach to getting nested xml data. Thank you
You can at least combine your
a
throughc
selector with a decendant selector (space in-between), like this:For the other, it depends on the size of the document as to if this would be faster: