Changed the workflow so that attribute evaluation is done by self during render and not done during parent's render.
Added 'foreach' case.