I don't really see the problem here. You can perfectly insert the new record element in the right position, as long as the initial record set is sorted: that's just before the first record with a name greater than the inserted record name.
So add the following code to the handler, and voilą!
elsif( $record->field( 'name') g +e $x->field( 'name')) { $x->paste( before => $recor +d); $item_pasted=1; return }
In reply to Re: use XML::Twig to insert data in the correct order
by mirod
in thread use XML::Twig to insert data in the correct order
by sureerat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |