3
아래 템플릿과 같은 1000 개의 엔티티가있는 xml이 있습니다.같은 이름의 자식 노드를 어떻게 처리합니까?
<data>
<row> ded</row>
<row> def </row>
<row> fff </row>
<row> fff </row>
</data>
XML :: Twig로 파싱해야합니다.
다음 코드를 사용합니다.
my $twig = XML::Twig->new(
twig_handlers => {
data => sub {
my $x1 = $_->first_child_trimmed_text('row');
print $x1;
#I need also here to run over the other rows and extract them
}
});
어떻게 행을 실행하여 추출 할 수 있습니까?