Looping over certain type of sub-nodes ..

Hi,

i have another newbie question regarding generation. I have to select some subnodes out of a collection, where node.attributes is a collection of OfAttribute. OfEntityAttribute extends OfAttribute, so i use currently the following statment.

node.attributes.where({~it => it.concept.name.equals("OfEntityAttribute"); })

Although the stamtements works fine, it s not a fine way of doing a selection. How can i circumvent this string based selection?

Best,

Dan

1 comment
Comment actions Permalink

Hi daniel,

use: node.attributes.where({~it => it.isInstanceOf(OfEntityAttribute); };

Regards,
Mirko

0

Please sign in to leave a comment.