perlquestion
jmurphy
Hello,
<P>
Warning XML and Perl newbie. I've created a DOM tree from XML::LibXML::SAX::Builder and the structure is roughly as follows:
<CODE>
<Message>
<Body>...Base64_Encoded_Text...</Body>
</Message>
</CODE>
I need to replace the Base64 encode text with its decoded value. So far I've been able to decode the contents of the Body with the following:
<CODE>
.
.
.
my $dom = $generator->execute("exec $opt_hash{sp} \'$opt_dates{start}\', \'$opt_dates{end}\'");
my $root = $dom->getDocumentElement;
my @bodies = $root->getElementsByTagName('Body');
for (my $i = 0; $i < scalar(@bodies); $i++) {
print decode_base64($bodies[$i]->getFirstChild->getData);
}
.
.
.
</CODE>
However, I'd like to modify the tree directly and not just the list that gets returned from getElementsByName. Can anyone help?
<P>
Thanks,
<BR>
Jay
<P>