I have a Perl class that is storing node and arc information for a tree data structure.
When I try to output this as XML using XML::Simple
I do not get the full expansion of the arrays.
I have
$table->{arcs} = @arcs;
$table->{nodes} = @nodes;
And when I try to output this as XML I get the following output
<?xml version='1.0'?>
<Root>
<arcs>0</arcs>
<nodes>0</nodes>
</Root>
But the information is stored into the arrays correctly.
Here is the code I am working with
my $xml = new XML::Simple(NoAttr => 1, RootName => 'Root', ForceArray => 1);
$xml->XMLout(
$table,
KeepRoot => 1,
OutputFile => $xml_directory . $out_file . ".xml",
XMLDecl => "<?xml version='1.0'?>",
NSExpand => 0,
ValueAttr => { \@node_values => 'node' }
);
Any ideas on how to expand out the arrays without having to hard code what you want your tags to be?
I would like to be able to go on the fly from data structure to XML for generation.