annotate _test/temp.pl @ 215:77a9934a44af

sync, migrating to XML::Compile
author cin
date Sun, 19 Aug 2012 22:27:43 +0400
parents 6adaeb86945d
children c477f24f1980
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
210
6adaeb86945d added IMPL::Web::AutoLocator
sergey
parents: 209
diff changeset
1 #!/usr/bin/perl
6adaeb86945d added IMPL::Web::AutoLocator
sergey
parents: 209
diff changeset
2 use strict;
6adaeb86945d added IMPL::Web::AutoLocator
sergey
parents: 209
diff changeset
3
215
77a9934a44af sync, migrating to XML::Compile
cin
parents: 210
diff changeset
4 use XML::Compile::Schema;
77a9934a44af sync, migrating to XML::Compile
cin
parents: 210
diff changeset
5 use XML::Compile::Util qw(pack_type);
77a9934a44af sync, migrating to XML::Compile
cin
parents: 210
diff changeset
6 use Data::Dumper;
210
6adaeb86945d added IMPL::Web::AutoLocator
sergey
parents: 209
diff changeset
7 use Time::HiRes qw(gettimeofday tv_interval);
6adaeb86945d added IMPL::Web::AutoLocator
sergey
parents: 209
diff changeset
8
215
77a9934a44af sync, migrating to XML::Compile
cin
parents: 210
diff changeset
9 my $schema = XML::Compile::Schema->new('Resources/person.xsd');
77a9934a44af sync, migrating to XML::Compile
cin
parents: 210
diff changeset
10
77a9934a44af sync, migrating to XML::Compile
cin
parents: 210
diff changeset
11 $schema->printIndex();
210
6adaeb86945d added IMPL::Web::AutoLocator
sergey
parents: 209
diff changeset
12
215
77a9934a44af sync, migrating to XML::Compile
cin
parents: 210
diff changeset
13 my $type = pack_type 'http://implab.org/person/', 'personInfo';
77a9934a44af sync, migrating to XML::Compile
cin
parents: 210
diff changeset
14 my $reader = $schema->compile(READER => $type);
210
6adaeb86945d added IMPL::Web::AutoLocator
sergey
parents: 209
diff changeset
15
6adaeb86945d added IMPL::Web::AutoLocator
sergey
parents: 209
diff changeset
16 my $t = [gettimeofday];
6adaeb86945d added IMPL::Web::AutoLocator
sergey
parents: 209
diff changeset
17
215
77a9934a44af sync, migrating to XML::Compile
cin
parents: 210
diff changeset
18 my $obj = $reader->('Resources/person_info.xml');
210
6adaeb86945d added IMPL::Web::AutoLocator
sergey
parents: 209
diff changeset
19
215
77a9934a44af sync, migrating to XML::Compile
cin
parents: 210
diff changeset
20 print "Parsing small Xml file: ",tv_interval($t,[gettimeofday]),"\n";
210
6adaeb86945d added IMPL::Web::AutoLocator
sergey
parents: 209
diff changeset
21
215
77a9934a44af sync, migrating to XML::Compile
cin
parents: 210
diff changeset
22 print Dumper( $obj );
77a9934a44af sync, migrating to XML::Compile
cin
parents: 210
diff changeset
23
77a9934a44af sync, migrating to XML::Compile
cin
parents: 210
diff changeset
24