Mercurial > pub > Impl
comparison _test/any.pl @ 103:c289ed9662ca
Schema beta 2
More strict validation, support for inflating a simple nodes and properties
author | wizard |
---|---|
date | Fri, 07 May 2010 18:17:40 +0400 |
parents | 16ada169ca75 |
children | 3f38dabaf5cc |
comparison
equal
deleted
inserted
replaced
102:cf3b6ef2be22 | 103:c289ed9662ca |
---|---|
2 use strict; | 2 use strict; |
3 use lib '..\Lib'; | 3 use lib '..\Lib'; |
4 | 4 |
5 require IMPL::DOM::Navigator::SimpleBuilder; | 5 require IMPL::DOM::Navigator::SimpleBuilder; |
6 require IMPL::DOM::XMLReader; | 6 require IMPL::DOM::XMLReader; |
7 require IMPL::DOM::Schema; | |
7 | 8 |
8 my $builder = IMPL::DOM::Navigator::SimpleBuilder->new(); | 9 my $builder = IMPL::DOM::Navigator::SimpleBuilder->new(); |
9 | 10 |
10 use Time::HiRes qw(gettimeofday tv_interval); | 11 use Time::HiRes qw(gettimeofday tv_interval); |
11 | 12 |
57 my $reader2 = IMPL::DOM::XMLReader->new( Navigator => $builder ); | 58 my $reader2 = IMPL::DOM::XMLReader->new( Navigator => $builder ); |
58 | 59 |
59 $reader2->ParseFile("Resources/person_info.xml"); | 60 $reader2->ParseFile("Resources/person_info.xml"); |
60 print "Parsing small Xml file: ",tv_interval($t,[gettimeofday]),"\n"; | 61 print "Parsing small Xml file: ",tv_interval($t,[gettimeofday]),"\n"; |
61 | 62 |
63 $t = [gettimeofday]; | |
64 IMPL::DOM::Schema->LoadSchema('Resources/form.xml') for 1..10; | |
65 print "Load a small schema 10 times: ",tv_interval($t,[gettimeofday]),"\n"; | |
66 | |
62 sub selectAll { | 67 sub selectAll { |
63 my $node = shift; | 68 my $node = shift; |
64 $node,map selectAll($_),@{$node->childNodes}; | 69 $node,map selectAll($_),@{$node->childNodes}; |
65 } | 70 } |