generic data-attribute conversion. ref #342