File: ex11.5.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 (28 lines) | stat: -rw-r--r-- 640 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#######################################################
#I am using XML::DT as below (the require is for selective module loading):
#######################################################
#
#require XML::DT; XML::DT->import ();
# Yes !!!

use strict;

use Data::Dumper;
use XML::DT;

my @order=qw(volume issue doi author f_page l_page artid epub ppub type);

my $M;

my %handler = (
   '-default'   => sub {$c},
   'article' => sub {
           $v{issue} = $dtatributes[1]->{number};
           $v{volume} = $dtatributes[2]->{number};

           $M .= join("\t", @v{(@order)}) . "\n";
    },
 );

 dt ("ex11.5.xml", %handler);
 print  $M;