Mercurial > pub > Impl
comparison Lib/IMPL/DOM/Schema/SimpleType.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 | 2904da230022 |
comparison
equal
deleted
inserted
replaced
193:8e8401c0aea4 | 194:4d0e1962161c |
---|---|
30 $this->{$nativeType} = $args{nativeType} if $args{nativeType}; | 30 $this->{$nativeType} = $args{nativeType} if $args{nativeType}; |
31 $this->{$messageWrongType} = $args{messageWrongType} || "A simple node '%Node.path%' is expected to be %Schema.nativeType%"; | 31 $this->{$messageWrongType} = $args{messageWrongType} || "A simple node '%Node.path%' is expected to be %Schema.nativeType%"; |
32 } | 32 } |
33 | 33 |
34 sub Validate { | 34 sub Validate { |
35 my ($this, $node, $ctx) = @_; | 35 my ($this, $node, $ctx) = @_; |
36 | 36 |
37 if ($this->{$nativeType}) { | 37 if ($this->{$nativeType}) { |
38 return new IMPL::DOM::Schema::ValidationError( | 38 return new IMPL::DOM::Schema::ValidationError( |
39 Node => $node, | 39 Node => $node, |
40 Source => $ctx && $ctx->{Source} || $this, | 40 Source => $ctx && $ctx->{Source} || $this, |
41 Schema => $this, | 41 Schema => $this, |
42 Message => $this->messageWrongType | 42 Message => $this->messageWrongType |
43 ) unless $node->isa($this->{$nativeType}); | 43 ) unless $node->isa($this->{$nativeType}); |
44 } | 44 } |
45 return $this->SUPER::Validate($node,$ctx); | 45 return $this->SUPER::Validate($node,$ctx); |
46 } | 46 } |
47 | 47 |
48 sub qname { | 48 sub qname { |
49 $_[0]->nodeName.'[type='.$_[0]->type.']'; | 49 $_[0]->nodeName.'[type='.$_[0]->type.']'; |
50 } | 50 } |
51 | 51 |
52 1; | 52 1; |
53 | 53 |
54 __END__ | 54 __END__ |