in reply to Moving a tag within text with XML::Twig
First off, to find all of those tags, you should check get_xpath:
Way simpler than rolling your own ;-).my @foots = $document->get_xpath('//text:span[@text:style-name="footno +te reference"]');
Rather than using subs_text, you may just want to use set_text to set the text to whatever you've already figured out. But I think your idea is sound - you want to remove some text from one side, and add it to the other.
|
|---|