File: ex11.1.pl

package info (click to toggle)
libxml-dt-perl 0.3-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, sarge
  • size: 296 kB
  • ctags: 42
  • sloc: perl: 914; xml: 424; makefile: 64
file content (17 lines) | stat: -rw-r--r-- 401 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/perl
use XML::DT;
use Data::Dumper;
%handler = ( -default => sub{$c},
             person   => sub{ print " 
$c->{name} 
$c->{address}[0]

Dear $c->{name}
Merry Christmas from Morris\n"; $c;},
             -type    => { people => 'SEQ',
                           person => MMAPON('address')});

$people = dt("ex11.1.xml", %handler);

print Dumper($people);
print $people->[1]{address}[1];