Code:
my $test = {
'a' => {
'disabled' => 'false',
'options' => '%build_options',
'mailStatus' => {},
'dependencies' =>{
'test' => {
'platforms' => {},
'name' => 'nightly-regressions',
'preRequisitePlatforms' => {},
'dependType' => 'pass'
},
},
'Above' => 'false',
'options' => {},
'critical' => 'true',
}
};
print XMLout($test, noattr=>1, KeepRoot=>1, RootName=>undef, NoEscape => 1);
When I run above code to convert hash to xml, one level of "test" was missing, the output xml I got was:
Output:
<a>
<Above>false</Above>
<critical>true</critical>
<dependencies>
<name>nightly-regressions</name>
<dependType>pass</dependType>
<platforms></platforms>
<preRequisitePlatforms></preRequisitePlatforms>
</dependencies>
<disabled>false</disabled>
<mailStatus></mailStatus>
<options></options>
</a>
Can anyone help me find what is wrong with my code?
XML::Simple? The documentation yells at you PLEASE DO NOT USE THIS MODULE IN NEW CODE...