use warnings; use strict; use XML::Twig; my $twig = new XML::Twig( twig_handlers => { desc => sub { $_->delete() }, img => sub { $_->delete() }, size => sub { $_->delete() }, }, ); $twig->parsefile('in.xml'); $twig->set_pretty_print('indented'); $twig->print_to_file('out.xml'); __END__ <items> <item> <id>12345</id> <name>Name1</name> </item> <item> <id>54321</id> <name>Name2</name> </item> </items>
In reply to Re: How to filter XML elements, exclude some
by toolic
in thread How to filter XML elements, exclude some
by ak1234
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |