I don't quite understand the question, but the arguments to the handler are the twig itself and the element object, not its tag name. So if you want to change the name of the element, you need $tag->set_tag( ...).
Also, the single quotes in '$tag_text' prevent interpolation (you will get the literal text $tag_text), get rid of them and you will get the value of $tag_text.
In reply to Re^3: XML::Twig parsing Problem
by mirod
in thread XML::Twig parsing Problem
by saurabh.x.pandey
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |