comparison Lib/IMPL/DOM/Schema/Node.pm @ 384:4edd36025051

DOM schema refactoring
author cin
date Mon, 10 Feb 2014 17:41:34 +0400
parents 2f16f13b000c
children 648dfaf642e0
comparison
equal deleted inserted replaced
383:2f16f13b000c 384:4edd36025051
43 $this->{$type} = $args{type}; 43 $this->{$type} = $args{type};
44 $this->{$name} = $args{name} or die new IMPL::InvalidArgumentException('Argument is required','name'); 44 $this->{$name} = $args{name} or die new IMPL::InvalidArgumentException('Argument is required','name');
45 } 45 }
46 46
47 sub Validate { 47 sub Validate {
48 my ($this,$node) = @_; 48 my ($this,$node,$ctx) = @_;
49 49
50 if (my $schemaType = $this->{$type} ? $this->document->resolveType($this->{$type}) : undef ) { 50 if (my $schemaType = $this->{$type} ? $this->document->ResolveType($this->{$type}) : undef ) {
51 my @errors = $schemaType->Validate($node,{Source => $this}); 51 my @errors = $schemaType->Validate($node,{Source => $this});
52 return @errors; 52 return @errors;
53 } else { 53 } else {
54 return (); 54 return ();
55 } 55 }
64 sub isMultiple { 64 sub isMultiple {
65 my ($this) = @_; 65 my ($this) = @_;
66 66
67 return ($this->{$maxOccur} eq 'unbounded' || $this->{$maxOccur} > 1 ) ? 1 : 0; 67 return ($this->{$maxOccur} eq 'unbounded' || $this->{$maxOccur} > 1 ) ? 1 : 0;
68 } 68 }
69
70 sub inflateValue {
71 $_[1];
72 }
73
74 sub inflator { undef }
75 69
76 sub qname { 70 sub qname {
77 $_[0]->nodeName.'[name='.$_[0]->{$name}.']'; 71 $_[0]->nodeName.'[name='.$_[0]->{$name}.']';
78 } 72 }
79 73
121 115
122 =item C<[get,set] name> 116 =item C<[get,set] name>
123 117
124 Имя узла. 118 Имя узла.
125 119
126 =item C<[get,set] display>
127
128 Имя узла для отображения.
129
130 =item C<[get,set] display_no>
131
132 Имя узла для отображения (родительный падеж).
133
134 =item C<[get,set] display_blame>
135
136 Имя узла для отображения (винительный падеж).
137
138 =back 120 =back
139 121
140 =cut 122 =cut