annotate _test/temp.pl @ 220:5c82c15b25b1

sync, updated schema
author sergey
date Thu, 23 Aug 2012 17:44:31 +0400
parents c477f24f1980
children edf011437be8
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';
220
5c82c15b25b1 sync, updated schema
sergey
parents: 219
diff changeset
14 my $reader = $schema->compile(
5c82c15b25b1 sync, updated schema
sergey
parents: 219
diff changeset
15 READER => $type,
5c82c15b25b1 sync, updated schema
sergey
parents: 219
diff changeset
16 xsi_type => {
5c82c15b25b1 sync, updated schema
sergey
parents: 219
diff changeset
17 pack_type('http://implab.org/schemas/resources','abstractResult') => 'AUTO'
5c82c15b25b1 sync, updated schema
sergey
parents: 219
diff changeset
18 }
5c82c15b25b1 sync, updated schema
sergey
parents: 219
diff changeset
19 );
210
6adaeb86945d added IMPL::Web::AutoLocator
sergey
parents: 209
diff changeset
20
6adaeb86945d added IMPL::Web::AutoLocator
sergey
parents: 209
diff changeset
21 my $t = [gettimeofday];
6adaeb86945d added IMPL::Web::AutoLocator
sergey
parents: 209
diff changeset
22
219
sergey
parents: 215
diff changeset
23 my $obj = $reader->('Resources/sample.xml');
210
6adaeb86945d added IMPL::Web::AutoLocator
sergey
parents: 209
diff changeset
24
215
77a9934a44af sync, migrating to XML::Compile
cin
parents: 210
diff changeset
25 print "Parsing small Xml file: ",tv_interval($t,[gettimeofday]),"\n";
210
6adaeb86945d added IMPL::Web::AutoLocator
sergey
parents: 209
diff changeset
26
215
77a9934a44af sync, migrating to XML::Compile
cin
parents: 210
diff changeset
27 print Dumper( $obj );
77a9934a44af sync, migrating to XML::Compile
cin
parents: 210
diff changeset
28
77a9934a44af sync, migrating to XML::Compile
cin
parents: 210
diff changeset
29