set_uk has asked for the wisdom of the Perl Monks concerning the following question:
Guess I have the answer.<element />
#!/usr/local/bin/perl -w use strict; use XML::Mini; use XML::Mini::Document; use Data::Dumper; my $xmlDoc = XML::Mini::Document->new(); #my $in_file_name="W:\\switch_upload\\xml\\batchjob.xml"; #my $out_file_name="W:\\switch_upload\\xml\\batchjob_out.xml"; my $root_dir="/export/home/set/scripts/perl/switch_upload/xml/"; my $in_file_name=$root_dir."batchjob.xml"; my $out_file_name=$root_dir."batchjob_out.xml"; #$xmlDoc->fromFile($in_file_name); $xmlDoc->parse($in_file_name); my $var = $xmlDoc->getElement("BATCH"); $var->attribute('name','JCI BATCH December 2003'); #print Dumper($xmlDoc); $xmlDoc->toFile($out_file_name);
janitored by ybiC: Retitle from "Mini::XML Stripping Last Character From Element Names" so title contains correct module name. Search-foo, yo. Also linked module name within post using PM [cpan://XML::Mini]
|
|---|