perlCrazy has asked for the wisdom of the Perl Monks concerning the following question:
#this variable will hold very large complex data structure. my $tableDetailsRef = {}; my $xmlFile = "test_name.xml"; my $targetNameStr = "target-name"; #Creating object for xml file my $xmls = XML::Simple->new( RootName => undef, ForceArray => ['tables'], KeyAttr => { table => 'id' }, ); my $contents = {}; $contents->{dspl}->{targetNamespace} = "string_test"; ################################################ if(defined $tableDetailsRef){ push @{ $contents->{dspl}->{'tables'} }, { table => $tableDetailsRef, }; } #################################################### ##Generate the xml file eval { $xmls->XMLout( $contents, xmldecl => '<?xml version="1.0" encoding="UTF +-8" standalone="no" ?>', OutputFile => $xmlFile ); }; if($@) { print "Exception: Could not xml file : $xmlFile, Error-$@"); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: out of memory issue while creating very large xml file using XML::Simple
by Discipulus (Canon) on Jul 22, 2014 at 11:27 UTC | |
|
Re: out of memory issue while creating very large xml file using XML::Simple
by Your Mother (Archbishop) on Jul 22, 2014 at 17:12 UTC | |
|
Re: out of memory issue while creating very large xml file using XML::Simple
by locked_user sundialsvc4 (Abbot) on Jul 22, 2014 at 14:42 UTC | |
by perlCrazy (Monk) on Jul 22, 2014 at 16:48 UTC |