| 1 | #!/usr/bin/perl | ||
| 2 | |||
| 3 | use Markup::Content; | ||
| 4 | |||
| 5 | my $content = Markup::Content->new( target => 'noname.html', | ||
| 6 | template => 'noname.xml', | ||
| 7 | target_options => { | ||
| 8 | no_squash_whitespace => [qw(script style pi code pre textarea)] | ||
| 9 | }, | ||
| 10 | template_options => { | ||
| 11 | callbacks => { | ||
| 12 | title => sub { | ||
| 13 | print shift()->get_text(); | ||
| 14 | } | ||
| 15 | } | ||
| 16 | }); | ||
| 17 | |||
| 18 | $content->extract(); | ||
| 19 | |||
| 20 | $content->tree->save_as(\*STDOUT); |