comparison _test/any.pl @ 36:1828103371d0

DOM in works
author Sergey
date Fri, 20 Nov 2009 16:48:08 +0300
parents 818c74b038ae
children c2e7f7c96bcd
comparison
equal deleted inserted replaced
35:f25d021780b3 36:1828103371d0
1 #!/usr/bin/perl -w 1 #!/usr/bin/perl -w
2 use strict; 2 use strict;
3 use lib '..\Lib';
3 4
4 my @data = (1,2,3,4); 5 require IMPL::DOM::Navigator::SimpleBuilder;
5 6
6 sub func { 7 my $builder = IMPL::DOM::Navigator::SimpleBuilder->new();
7 return \@data; 8
8 } 9 use Time::HiRes qw(gettimeofday tv_interval);
9 10
10 print "$_\n" and $data[3]=0 foreach @{func()}; 11 my $t = [gettimeofday];
12
13 $builder->NavigateCreate('personInfo', version => '1');
14 $builder->NavigateCreate('firstName')->nodeValue('Nemo');
15 $builder->Back();
16 $builder->NavigateCreate('lastName')->nodeValue('Nobel');
17 $builder->Back();
18 $builder->NavigateCreate('lastName')->nodeValue('Gardum');
19 $builder->Back();
20 for(1..10000) {
21 $builder->NavigateCreate('address', local => 1);
22 $builder->NavigateCreate('street')->nodeValue('Hellroad');
23 $builder->Back();
24 $builder->NavigateCreate('line')->nodeValue($_);
25 $builder->Back();
26 $builder->Back();
27 }
28 $builder->Back();
29
30 print "Build: ",tv_interval($t,[gettimeofday]),"\n";