Mercurial > pub > Impl
comparison Lib/IMPL/DOM/Schema/Validator/RegExp.pm @ 238:b8c724f6de36
DOM model refactoring
TT view refactoring, controls are no longer derived from DOM nodes
bugfixes
author | sergey |
---|---|
date | Tue, 16 Oct 2012 01:33:06 +0400 |
parents | 2904da230022 |
children | 5aff94ba842f |
comparison
equal
deleted
inserted
replaced
237:61db68166c37 | 238:b8c724f6de36 |
---|---|
19 } | 19 } |
20 | 20 |
21 sub CTOR { | 21 sub CTOR { |
22 my ($this,%args) = @_; | 22 my ($this,%args) = @_; |
23 | 23 |
24 $this->message($args{message} || "A %Node.nodeName% doesn't match to the format %Schema.display%"); | 24 $this->message($args{message} || "A %node.nodeName% doesn't match to the format %schema.display%"); |
25 } | 25 } |
26 | 26 |
27 sub Validate { | 27 sub Validate { |
28 my ($this,$node,$ctx) = @_; | 28 my ($this,$node,$ctx) = @_; |
29 | 29 |
30 my $rx = $this->_rx() || $this->_rx( map qr{$_}, $this->nodeValue ); | 30 my $rx = $this->_rx() || $this->_rx( map qr{$_}, $this->nodeValue ); |
31 | 31 |
32 return new IMPL::DOM::Schema::ValidationError( | 32 return new IMPL::DOM::Schema::ValidationError( |
33 Node => $node, | 33 node => $node, |
34 Source => $ctx && $ctx->{Source} || $this->parentNode, | 34 source => $ctx && $ctx->{Source} || $this->parentNode, |
35 Schema => $this->parentNode, | 35 schema => $this->parentNode, |
36 Message => $this->message | 36 message => $this->message |
37 ) unless (not $node->isComplex) and $node->nodeValue =~ /($rx)/; | 37 ) unless (not $node->isComplex) and $node->nodeValue =~ /($rx)/; |
38 | 38 |
39 $node->nodeValue($1) if $this->launder; | 39 $node->nodeValue($1) if $this->launder; |
40 | 40 |
41 return (); | 41 return (); |