Use the AttributeSet instead of AttributeWithIndex object.