diff Lib/IMPL/DOM/Schema/Node.pm @ 19:1ca530e5c9c5

DOM схема, требует переработки в части схемы для описания схем. Автоверификация не проходит
author Sergey
date Fri, 11 Sep 2009 16:30:39 +0400
parents 818c74b038ae
children 267460284fb3
line wrap: on
line diff
--- a/Lib/IMPL/DOM/Schema/Node.pm	Thu Sep 10 17:42:47 2009 +0400
+++ b/Lib/IMPL/DOM/Schema/Node.pm	Fri Sep 11 16:30:39 2009 +0400
@@ -8,9 +8,9 @@
 use IMPL::Class::Property::Direct;
 
 BEGIN {
-    public _dom property minOccur => prop_all;
-    public _dom property maxOccur => prop_all;
-    public _dom property type => prop_all
+    public property minOccur => prop_all;
+    public property maxOccur => prop_all;
+    public property type => prop_all
 }
 
 __PACKAGE__->PassThroughArgs;
@@ -18,11 +18,19 @@
 sub CTOR {
     my ($this,%args) = @_;
     
-    $this->minOccur($args{minOcuur});
-    $this->maxOccur($args{maxOccur});
+    $this->minOccur(defined $args{minOcuur} ? $args{minOcuur} : 1);
+    $this->maxOccur(defined $args{maxOccur} ? $args{maxOccur} : 1);
     $this->type($args{type});
 }
 
+sub Validate {
+    my ($this,$node) = @_;
+    
+    if (my $schemaType = $this->type ? $this->rootNode->resolveType($this->type) : undef ) {
+        return $schemaType->Validate($node);
+    }
+}
+
 1;
 
 __END__