# HG changeset patch # User wizard # Date 1273532389 -14400 # Node ID a6e9759ff88a6b66456b2f6b7f383e3d65458b8d # Parent 196bf443b5e1c5abe96fc2af245c073bdb3b3a06 Fixed a validation errors parameters diff -r 196bf443b5e1 -r a6e9759ff88a Lib/IMPL/DOM/Schema/ComplexNode.pm --- a/Lib/IMPL/DOM/Schema/ComplexNode.pm Tue May 11 02:42:59 2010 +0400 +++ b/Lib/IMPL/DOM/Schema/ComplexNode.pm Tue May 11 02:59:49 2010 +0400 @@ -25,9 +25,9 @@ } sub Validate { - my ($this,$node) = @_; + my ($this,$node,$ctx) = @_; - map $_->Validate($node), @{$this->childNodes}; + map $_->Validate($node,$ctx), @{$this->childNodes}; } 1; diff -r 196bf443b5e1 -r a6e9759ff88a Lib/IMPL/DOM/Schema/ComplexType.pm --- a/Lib/IMPL/DOM/Schema/ComplexType.pm Tue May 11 02:42:59 2010 +0400 +++ b/Lib/IMPL/DOM/Schema/ComplexType.pm Tue May 11 02:59:49 2010 +0400 @@ -30,17 +30,17 @@ } sub Validate { - my ($this, $node) = @_; + my ($this, $node,$ctx) = @_; if ($this->{$nativeType}) { return new IMPL::DOM::Schema::ValidationError( Node => $node, - Source => $this, + Source => $ctx && $ctx->{Source} || $this, Schema => $this, Message => $this->messageWrongType ) unless $node->isa($this->{$nativeType}); } - return $this->SUPER::Validate($node); + return $this->SUPER::Validate($node,$ctx); } sub qname { diff -r 196bf443b5e1 -r a6e9759ff88a Lib/IMPL/DOM/Schema/SimpleType.pm --- a/Lib/IMPL/DOM/Schema/SimpleType.pm Tue May 11 02:42:59 2010 +0400 +++ b/Lib/IMPL/DOM/Schema/SimpleType.pm Tue May 11 02:59:49 2010 +0400 @@ -40,7 +40,7 @@ Message => $this->messageWrongType ) unless $node->isa($this->{$nativeType}); } - return $this->SUPER::Validate($node); + return $this->SUPER::Validate($node,$ctx); } sub qname { diff -r 196bf443b5e1 -r a6e9759ff88a Lib/IMPL/DOM/Schema/Validator/RegExp.pm --- a/Lib/IMPL/DOM/Schema/Validator/RegExp.pm Tue May 11 02:42:59 2010 +0400 +++ b/Lib/IMPL/DOM/Schema/Validator/RegExp.pm Tue May 11 02:59:49 2010 +0400 @@ -28,7 +28,7 @@ my $rx = $this->nodeValue; return new IMPL::DOM::Schema::ValidationError( Node => $node, - Source => ( $ctx && $ctx->{Source} ) || $this->parentNode, + Source => $ctx && $ctx->{Source} || $this->parentNode, Schema => $this->parentNode, Message => $this->message ) unless (not $node->isComplex) and $node->nodeValue =~ /$rx/;