diff Lib/IMPL/DOM/Schema/NodeList.pm @ 102:cf3b6ef2be22

Schema beta version
author wizard
date Fri, 07 May 2010 08:05:23 +0400
parents df6b4f054957
children a4b0a819bbda
line wrap: on
line diff
--- a/Lib/IMPL/DOM/Schema/NodeList.pm	Thu May 06 17:55:59 2010 +0400
+++ b/Lib/IMPL/DOM/Schema/NodeList.pm	Fri May 07 08:05:23 2010 +0400
@@ -19,7 +19,7 @@
     my ($this,%args) = @_;
     
     $this->messageUnexpected($args{messageUnexpected} || 'A %Node.nodeName% isn\'t allowed in %Node.parentNode.path%');
-    $this->messageNodesRequired($args{messageNodesRequired} || 'A %Schema.name% is required in the node %Node.path%');
+    $this->messageNodesRequired($args{messageNodesRequired} || 'A %Schema.name% is required in the node %Parent.path%');
 }
 
 sub Validate {
@@ -38,6 +38,7 @@
             return new IMPL::DOM::Schema::ValidationError (
                 Message => $this->messageUnexpected,
                 Node => $child,
+                Parent => $node,
                 Schema => $info->{Schema},
                 Source => $this
             ) if $info->{Min} > $info->{Seen};
@@ -49,6 +50,7 @@
         return new IMPL::DOM::Schema::ValidationError (
             Message => $this->messageUnexpected,
             Node => $child,
+            Parent => $node,
             Source => $this
         ) unless $info;
         
@@ -71,6 +73,7 @@
             Error => 1,
             Message => $this->messageUnexpected,
             Node => $child,
+            Parent => $node,
             Source => $this,
         ) if $info->{Max} and $info->{Seen} > $info->{Max};
     }
@@ -81,6 +84,7 @@
             Error => 1,
             Message => $this->messageNodesRequired,
             Source => $this,
+            Parent => $node,
             Schema => $info->{Schema}
         ) if $info->{Seen} < $info->{Min};