# HG changeset patch # User sergey # Date 1345554827 -14400 # Node ID c477f24f198041aab33c7e9f9df90b2ea5a96e0d # Parent 358f867712b44993a1d83ec0fae6244c42360d79 sync diff -r 358f867712b4 -r c477f24f1980 Lib/IMPL/Serialization.pm --- a/Lib/IMPL/Serialization.pm Mon Aug 20 17:24:48 2012 +0400 +++ b/Lib/IMPL/Serialization.pm Tue Aug 21 17:13:47 2012 +0400 @@ -182,7 +182,7 @@ die new Exception("A reference to a not existing object found") if not $refObj; my $rhCurrentObj = $this->{$CurrentObject}; - die new Exception("Found a reference to an object as a root of an object's graph") if not $rhCurrentObj; + die new Exception("The root object can't be a reference") if not $rhCurrentObj; if ($rhCurrentObj->{'Data'}) { die new Exception("Invalid serializaed data","Plain deserialization data for an object already exist") if not ref $rhCurrentObj->{'Data'}; diff -r 358f867712b4 -r c477f24f1980 _test/Resources/resources.xsd --- a/_test/Resources/resources.xsd Mon Aug 20 17:24:48 2012 +0400 +++ b/_test/Resources/resources.xsd Tue Aug 21 17:13:47 2012 +0400 @@ -1,13 +1,13 @@ - + - + - + + + + + + @@ -41,9 +46,69 @@ - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r 358f867712b4 -r c477f24f1980 _test/Resources/sample.xml --- a/_test/Resources/sample.xml Mon Aug 20 17:24:48 2012 +0400 +++ b/_test/Resources/sample.xml Tue Aug 21 17:13:47 2012 +0400 @@ -1,17 +1,19 @@ - + - - - - - + + + + + + + + - - - + + \ No newline at end of file diff -r 358f867712b4 -r c477f24f1980 _test/temp.pl --- a/_test/temp.pl Mon Aug 20 17:24:48 2012 +0400 +++ b/_test/temp.pl Tue Aug 21 17:13:47 2012 +0400 @@ -2,20 +2,20 @@ use strict; use XML::Compile::Schema; -use XML::Compile::Util qw(pack_type); +use XML::Compile::Util qw(pack_type pack_id); use Data::Dumper; use Time::HiRes qw(gettimeofday tv_interval); -my $schema = XML::Compile::Schema->new('Resources/person.xsd'); +my $schema = XML::Compile::Schema->new('Resources/resources.xsd'); $schema->printIndex(); -my $type = pack_type 'http://implab.org/person/', 'personInfo'; +my $type = pack_type 'http://implab.org/schemas/resources', 'resources'; my $reader = $schema->compile(READER => $type); my $t = [gettimeofday]; -my $obj = $reader->('Resources/person_info.xml'); +my $obj = $reader->('Resources/sample.xml'); print "Parsing small Xml file: ",tv_interval($t,[gettimeofday]),"\n";