view _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
line wrap: on
line source

#!/usr/bin/perl
use strict;

use XML::Compile::Schema;
use XML::Compile::Util qw(pack_type);
use Data::Dumper;
use Time::HiRes qw(gettimeofday tv_interval);
    
my $schema = XML::Compile::Schema->new('Resources/person.xsd');

$schema->printIndex();

my $type = pack_type 'http://implab.org/person/', 'personInfo';
my $reader = $schema->compile(READER => $type);

my $t = [gettimeofday];

my $obj = $reader->('Resources/person_info.xml');

print "Parsing small Xml file: ",tv_interval($t,[gettimeofday]),"\n";

print Dumper( $obj );