Mercurial > pub > Impl
diff Lib/IMPL/DOM/XMLReader.pm @ 194:4d0e1962161c
Replaced tabs with spaces
IMPL::Web::View - fixed document model, new features (control classes, document constructor parameters)
author | cin |
---|---|
date | Tue, 10 Apr 2012 20:08:29 +0400 |
parents | d1676be8afcc |
children | 0f59b2de72af |
line wrap: on
line diff
--- a/Lib/IMPL/DOM/XMLReader.pm Tue Apr 10 08:13:22 2012 +0400 +++ b/Lib/IMPL/DOM/XMLReader.pm Tue Apr 10 20:08:29 2012 +0400 @@ -69,31 +69,31 @@ } sub LoadDocument { - my ($self,$file,$schema) = @_; - - my $parser; - if ($schema) { - $schema = IMPL::DOM::Schema->LoadSchema($schema) if not ref $schema; - $parser = $self->new( - Navigator => IMPL::DOM::Navigator::Builder->new( - 'IMPL::DOM::Document', - $schema - ) - ); - } else { - $parser = $self->new( - Navigator => IMPL::DOM::Navigator::SimpleBuilder->new() - ); - } - - $parser->ParseFile($file); - my $doc = $parser->Navigator->Document; - if ($schema) { - my @errors = $parser->Navigator->BuildErrors; - push @errors, $schema->Validate($doc); - die new IMPL::Exception("Loaded document doesn't match the schema", @errors) if @errors; - } - return $doc; + my ($self,$file,$schema) = @_; + + my $parser; + if ($schema) { + $schema = IMPL::DOM::Schema->LoadSchema($schema) if not ref $schema; + $parser = $self->new( + Navigator => IMPL::DOM::Navigator::Builder->new( + 'IMPL::DOM::Document', + $schema + ) + ); + } else { + $parser = $self->new( + Navigator => IMPL::DOM::Navigator::SimpleBuilder->new() + ); + } + + $parser->ParseFile($file); + my $doc = $parser->Navigator->Document; + if ($schema) { + my @errors = $parser->Navigator->BuildErrors; + push @errors, $schema->Validate($doc); + die new IMPL::Exception("Loaded document doesn't match the schema", @errors) if @errors; + } + return $doc; } 1;