add tagNameFunc to handle complicated tagName