Meanwhile we found an own solution.
We noticed that the command 'oid_name(oid_caret())' returns us the current tag name where the cursor is inside.
The command 'current_tag_name()' returns the element at the left from the cursor.
So we could find an own workaround.