다음과 같은 형식의 엔터티가있는 큰 xml 파일을 가지고 있습니다. 누군가 xml :: twig로 어떻게 처리 할 수 있습니까?xml :: twig을 사용하여 xml 파일을 구문 분석
<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);
XML : : 간단하지만 파일이 너무 크고 어떤 오류 메시지 (들) 당신이 얻을 않았다 – smith
interpeter 펄을 붙어 :
그래서 코드의 구조는 다음과 같이해야합니까? 시도한 코드의 관련 스 니펫을 게시하십시오. –시도한 스크립트를 게시하십시오. – Dave