#!/usr/bin/perl use XML::DT ; use Data::Dumper; my $filename = shift; %handler=( '-outputenc' => 'ISO-8859-1', 'article/tit' => sub{"article title is : $c"}, 'section/tit' => sub{"section title is : $c"}, # 'tit' => sub{"any type title is : $c"}, ); print XML::DT::pathdt($filename,%handler);