annotate _test/temp.pl @ 219:c477f24f1980

sync
author sergey
date Tue, 21 Aug 2012 17:13:47 +0400
parents 77a9934a44af
children 5c82c15b25b1
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;
219
sergey
parents: 215
diff changeset
5 use XML::Compile::Util qw(pack_type pack_id);
215
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
219
sergey
parents: 215
diff changeset
9 my $schema = XML::Compile::Schema->new('Resources/resources.xsd');
215
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
219
sergey
parents: 215
diff changeset
13 my $type = pack_type 'http://implab.org/schemas/resources', 'resources';
215
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
219
sergey
parents: 215
diff changeset
18 my $obj = $reader->('Resources/sample.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