I need insert a child in child element. I have two child, the first child cut and paste to second child insert as first child.
xml:
<fn id="fn1_1">
<label>1</label>
<p>The distinguished as &#x2018;bisexuation.&#x2019;</p>
</fn>
I tried
sub fngroup{
my ($xml_twig_content, $fn_group) = @_;
@text = $fn_group->children;
my $cut;
foreach my $fn (@text){
$cut = $fn->cut if ($fn->name =~ /label/);
if ($fn =~ /p/){
$fn->paste('first_child', $cut);
}
}
}
I can't process it. how can I cut label and the label tag paste to p tag as first_child.
I need:
<fn id="fn1_1">
<p><label>1</label> The distinguished as &#x2018;bisexuation.&#x2019;</p>
</fn>