-
-
The book of books
Sally
1/2/2008
-
The page of pages
Amanda
6/3/1998
The book of pages
John
6/22/1963
The rock of ages
Frank
5/21/2004
The age of rocks
Mary
8/16/1944
####
my $twig = XML::Twig->new(
twig_handlers => { '/ArrayOfBooks/Book' => \§}
);
my $input ='Books.XML';
$twig->parsefile($input);
sub sect
{
my ($twig, $ele) = @_;
depth++
#if node does not contain children
{
end_element($ele);
depth--;
return;
}
#node contains children
sec($ele);
}
sub end_element
{
# I need both key and value. eg Title: The page of pages
my ($leaf) = @_;
print $key;
}