Mercurial > pub > Impl
comparison Lib/IMPL/DOM/XMLReader.pm @ 368:010ceafd0c5a
form metadata + tests
| author | cin |
|---|---|
| date | Wed, 04 Dec 2013 17:31:53 +0400 |
| parents | 4ddb27ff4a0b |
| children | 4edd36025051 |
comparison
equal
deleted
inserted
replaced
| 367:608e74bc309f | 368:010ceafd0c5a |
|---|---|
| 89 ); | 89 ); |
| 90 } | 90 } |
| 91 | 91 |
| 92 $parser->ParseFile($file); | 92 $parser->ParseFile($file); |
| 93 my $doc = $parser->Navigator->Document; | 93 my $doc = $parser->Navigator->Document; |
| 94 my @errors; | |
| 94 if ($schema) { | 95 if ($schema) { |
| 95 my @errors = $parser->Navigator->BuildErrors; | 96 @errors = $parser->Navigator->BuildErrors; |
| 96 push @errors, $schema->Validate($doc); | 97 push @errors, $schema->Validate($doc); |
| 97 die new IMPL::Exception("Loaded document doesn't match the schema", @errors) if @errors; | |
| 98 } | 98 } |
| 99 return $doc; | 99 |
| 100 if (wantarray) { | |
| 101 return $doc,\@errors; | |
| 102 } else { | |
| 103 die new IMPL::Exception("Loaded document doesn't match the schema", @errors) if @errors; | |
| 104 return $doc; | |
| 105 } | |
| 100 } | 106 } |
| 101 | 107 |
| 102 1; | 108 1; |
| 103 | 109 |
| 104 __END__ | 110 __END__ |
