I have the following a large xml file which have entities on the below format : could someone help how can i proccess it with xml::twig ?
<root >
<entity id="1" last_modified="2011-10-1">
<entity_title> title</entity_title>
<entity_description>description </entity_description>
<entity_x> x </entity_x>
<entity_y> x </entity_y>
<entity_childs>
<child flag="1">
<child_name>name<child_name>
<child_type>type1</child_type>
<child_x> some_text</child__x>
</child>
<child flag="1">
<child_name>name1<child_name>
<child_type>type2</child_type>
<child_x> some_text</child__x>
</child>
<entity_sibling>
<family value="1" name="xc">fed</ext_ref>
<family value="1" name="df">ff</ext_ref>
</entity_sibling>
<\root>
;
I run the below code and get out of memory !
my $file = shift ||die $!;
my $twig = XML::Twig->new();
my $config = $twig->parsefile( $file )->simplify();
print Dumper( $config );
entity
tag). I must be cranky today, but it really annoys me when people ask for help but don't even take the time to check their data. And yes, in this case it impacts the answer, because I have no idea whether there is a single top-level entity in the file or several. So my answer below is not as detailed as it could have been.