I am not sure what you want to do exactly. If you could provide a better text case, that is code I can run,, with input and expected output, then I would have a better chance at giving you an answer. It would essentially convert your explanations into code, so there is much less chance for misinterpretation. I suspect the solution involves either subs_text or mark but I can't say for sure.
A example test would be:
#!/usr/bin/perl use strict; use warnings; use Test::More tests => 1; use XML::Twig; my $doc='<paragraph> Some <bold>text</bold> here which may be any <bol +d>length</bold> and <bold>contain</bold> a number of child tags.</par +agraph>'; my $expected= '<paragraph> Some <bold>text</bold> here which <bold>may +</bold> be any <bold>length</bold> and <bold>contain</bold> a number +of <bold>child</bold> tags.</paragraph>'; my $t=XML::Twig->new->parse( $doc); $t->root->mark( qr/(may|child)/, 'bold'); is( $t->sprint, $expected, 'simple replace');
In reply to Re: Twig Mixed Content Child Text Replace Issues
by mirod
in thread Twig Mixed Content Child Text Replace Issues
by unknown_varmit
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |