comparison _test/temp.pl @ 219:c477f24f1980

sync
author sergey
date Tue, 21 Aug 2012 17:13:47 +0400
parents 77a9934a44af
children 5c82c15b25b1
comparison
equal deleted inserted replaced
218:358f867712b4 219:c477f24f1980
1 #!/usr/bin/perl 1 #!/usr/bin/perl
2 use strict; 2 use strict;
3 3
4 use XML::Compile::Schema; 4 use XML::Compile::Schema;
5 use XML::Compile::Util qw(pack_type); 5 use XML::Compile::Util qw(pack_type pack_id);
6 use Data::Dumper; 6 use Data::Dumper;
7 use Time::HiRes qw(gettimeofday tv_interval); 7 use Time::HiRes qw(gettimeofday tv_interval);
8 8
9 my $schema = XML::Compile::Schema->new('Resources/person.xsd'); 9 my $schema = XML::Compile::Schema->new('Resources/resources.xsd');
10 10
11 $schema->printIndex(); 11 $schema->printIndex();
12 12
13 my $type = pack_type 'http://implab.org/person/', 'personInfo'; 13 my $type = pack_type 'http://implab.org/schemas/resources', 'resources';
14 my $reader = $schema->compile(READER => $type); 14 my $reader = $schema->compile(READER => $type);
15 15
16 my $t = [gettimeofday]; 16 my $t = [gettimeofday];
17 17
18 my $obj = $reader->('Resources/person_info.xml'); 18 my $obj = $reader->('Resources/sample.xml');
19 19
20 print "Parsing small Xml file: ",tv_interval($t,[gettimeofday]),"\n"; 20 print "Parsing small Xml file: ",tv_interval($t,[gettimeofday]),"\n";
21 21
22 print Dumper( $obj ); 22 print Dumper( $obj );
23 23