Rewrite some logic in getTagInfo and getTagAttributes apis for CodeMirror updates in xml mode.