我有以下一个大型 xml 文件,其中包含以下格式的实体:有人可以帮助我如何使用 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>
;
我运行以下代码并内存不足!
my $file = shift ||die $!;
my $twig = XML::Twig->new();
my $config = $twig->parsefile( $file )->simplify();
print Dumper( $config );