You realize that lang attributes can be on tags with nested contents and even nested themselves. So a tag name stack must be built to properly handle all of these cases and to properly unwind nested tags with language attributes. So the shortcut approach is a non-starter.
KevinH
|