diff Lib/IMPL/DOM/Schema/Node.pm @ 104:196bf443b5e1

DOM::Schema RC0 inflators support, validation and some other things, Minor and major fixes almost for everything. A 'Source' property of the ValidationErrors generated from a NodeSet or a NodeList is subject to change in the future.
author wizard
date Tue, 11 May 2010 02:42:59 +0400
parents c289ed9662ca
children e6447ad85cb4
line wrap: on
line diff
--- a/Lib/IMPL/DOM/Schema/Node.pm	Fri May 07 18:17:40 2010 +0400
+++ b/Lib/IMPL/DOM/Schema/Node.pm	Tue May 11 02:42:59 2010 +0400
@@ -37,13 +37,18 @@
     my ($this,$node) = @_;
     
     if (my $schemaType = $this->{$type} ? $this->document->resolveType($this->{$type}) : undef ) {
-        return $schemaType->Validate($node);
+        my @errors = $schemaType->Validate($node,{Source => $this});
+        return @errors;
     } else {
         return ();
     }
 }
 
-sub inflator { undef; }
+sub inflateValue {
+	$_[1];
+}
+
+sub inflator { undef }
 
 sub qname {
     $_[0]->nodeName.'[name='.$_[0]->{$name}.']';
@@ -56,8 +61,8 @@
 
 =head1 SYNOPSIS
 
-package Restriction;
-use base qw(IMPL::DOM::Schema::Item);
+package SchemaEntity;
+use base qw(IMPL::DOM::Schema::Node);
 
 sub Validate {
     my ($this,$node) = @_;