set_uk has asked for the wisdom of the Perl Monks concerning the following question:

Using XML::Mini for the first time today. Read in an XML file, modified an attribute and wrote the file back out again. XML::Mini has stripped off the last character of any element names which dont hold data. Such as <element/>. Anyone else had this issue? Works OK when elements with no data in look like  <element> </element> Also works OK when the the empty element looks like
<element />
Guess I have the answer.
#!/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]