Everything I have done with XML has been with XML::Twig Of course there has been very little.
Recently I faced a problem kind of like this. I had a XML file that had fields that need to be updated each day the way I did it was to create a handler for element that needed to be updated
my $twig = XML::Twig->new(twig_handlers =>
{MONTH => \&upd_month,
DAY => \&upd_day,
YEAR => \&upd_year
},
PrettyPrint =>'indented',
);
$twig->parsefile(XML_FILE);
Then in the handlers i used the set_text method to replace the value to what I needed
sub upd_month{
my( $t, $post)= @_;
$post->set_text("$expire{month}");
}
sub upd_day{
my( $t, $post)= @_;
$post->set_text("$expire{day}");
}
sub upd_year{
my( $t, $post)= @_;
$post->set_text("$expire{year}");
}
I dont if this would work well for your situation but it fit the niche I had to fill so I thought I would pass it along.
Desdinova