I donβt know how much I know. If you are sure that the node name has a prefix, you can use this:
substring-before(name(), ':')
or this if you are not sure:
substring-before( name(), concat(':', local-name()) )
The last expression is based on the fact that substring-before() returns an empty string when the search string is not found. Thus, it will work correctly with prefix and unsigned names.
source share