You can't do that with a simple condition. The simplest is probably to do something like (untested):
my @sheads= $t->root->children( 'shead'); foreach my $shead (@sheads) { my $aheadtext= $shead->wrap_in( 'aheadtext'); my $more_text= $aheadtext->next_sibling; while( $more_text->tag ne 'shead') { $more_text->move( last_child => $aheadtext); $more_text= $aheadtext->next_sibling; } }
In reply to Re: XML::Twig - extracting some tags from siblings
by mirod
in thread XML::Twig - extracting some tags from siblings
by aakikce
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |