pick up element attributes

Also, if element content string is empty, don't register it.