annotate Lib/IMPL/DOM/Navigator/Builder.pm @ 357:ec58c47edb52

web security: code cleanup, refactoring
author cin
date Fri, 18 Oct 2013 15:10:10 +0400
parents 4ddb27ff4a0b
children 010ceafd0c5a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
1 package IMPL::DOM::Navigator::Builder;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
2 use strict;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
3 use warnings;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
4
236
2904da230022 DOM refactoring
sergey
parents: 206
diff changeset
5 use IMPL::Const qw(:prop);
2904da230022 DOM refactoring
sergey
parents: 206
diff changeset
6
165
76515373dac0 Added Class::Template,
wizard
parents: 148
diff changeset
7 use parent qw(IMPL::DOM::Navigator);
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
8 use IMPL::Class::Property;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
9 require IMPL::DOM::Navigator::SchemaNavigator;
104
196bf443b5e1 DOM::Schema RC0 inflators support, validation and some other things,
wizard
parents: 103
diff changeset
10 require IMPL::DOM::Schema::ValidationError;
106
83e356614c1e DOM Builder now is a navigator like SimpleBuilder
wizard
parents: 104
diff changeset
11 use IMPL::DOM::Document;
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
12
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
13 BEGIN {
236
2904da230022 DOM refactoring
sergey
parents: 206
diff changeset
14 private _direct property _schemaNavi => PROP_RW;
2904da230022 DOM refactoring
sergey
parents: 206
diff changeset
15 private _direct property _docClass => PROP_RW;
2904da230022 DOM refactoring
sergey
parents: 206
diff changeset
16 public _direct property BuildErrors => PROP_RO | PROP_LIST;
2904da230022 DOM refactoring
sergey
parents: 206
diff changeset
17 public _direct property Document => PROP_RO;
2904da230022 DOM refactoring
sergey
parents: 206
diff changeset
18 public _direct property ignoreUndefined => PROP_RO;
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
19 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
20
106
83e356614c1e DOM Builder now is a navigator like SimpleBuilder
wizard
parents: 104
diff changeset
21 our %CTOR = (
112
0ed8e2541b1c Form processing mechanism
wizard
parents: 106
diff changeset
22 'IMPL::DOM::Navigator' => sub { IMPL::DOM::Document->Empty; }
106
83e356614c1e DOM Builder now is a navigator like SimpleBuilder
wizard
parents: 104
diff changeset
23 );
83e356614c1e DOM Builder now is a navigator like SimpleBuilder
wizard
parents: 104
diff changeset
24
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
25 sub CTOR {
236
2904da230022 DOM refactoring
sergey
parents: 206
diff changeset
26 my ($this,$docClass,$schema,%opts) = @_;
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
27
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
28 $this->{$_docClass} = $docClass;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
29 $this->{$_schemaNavi} = $schema ? IMPL::DOM::Navigator::SchemaNavigator->new($schema) : undef;
236
2904da230022 DOM refactoring
sergey
parents: 206
diff changeset
30
2904da230022 DOM refactoring
sergey
parents: 206
diff changeset
31 $this->{$ignoreUndefined} = $opts{ignoreUndefined} if $opts{ignoreUndefined};
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
32 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
33
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
34 sub NavigateCreate {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
35 my ($this,$nodeName,%props) = @_;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
36
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
37 if (my $schemaNode = $this->{$_schemaNavi}->NavigateName($nodeName)) {
104
196bf443b5e1 DOM::Schema RC0 inflators support, validation and some other things,
wizard
parents: 103
diff changeset
38 my $class = $schemaNode->can('nativeType') ? $schemaNode->nativeType || 'IMPL::DOM::Node' : 'IMPL::DOM::Node';
196bf443b5e1 DOM::Schema RC0 inflators support, validation and some other things,
wizard
parents: 103
diff changeset
39
148
e6447ad85cb4 DOM objects now have a schema and schemaSource properties
wizard
parents: 113
diff changeset
40 my $schemaSource = $this->{$_schemaNavi}->SourceSchemaNode;
e6447ad85cb4 DOM objects now have a schema and schemaSource properties
wizard
parents: 113
diff changeset
41
104
196bf443b5e1 DOM::Schema RC0 inflators support, validation and some other things,
wizard
parents: 103
diff changeset
42 my @errors = $this->inflateProperties($schemaNode,\%props);
250
129e48bb5afb DOM refactoring
sergey
parents: 246
diff changeset
43
148
e6447ad85cb4 DOM objects now have a schema and schemaSource properties
wizard
parents: 113
diff changeset
44 $props{schema} = $schemaNode;
e6447ad85cb4 DOM objects now have a schema and schemaSource properties
wizard
parents: 113
diff changeset
45 $props{schemaSource} = $schemaSource;
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
46
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
47 my $node;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
48 if (! $this->{$Document}) {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
49 $node = $this->{$Document} = $this->{$_docClass}->new(nodeName => $nodeName,%props);
106
83e356614c1e DOM Builder now is a navigator like SimpleBuilder
wizard
parents: 104
diff changeset
50 $this->_initNavigator($node);
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
51 } else {
250
129e48bb5afb DOM refactoring
sergey
parents: 246
diff changeset
52 die new IMPL::InvalidOperationException('Can\'t create a second top level element') unless $this->Current;
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
53 $node = $this->{$Document}->Create($nodeName,$class,\%props);
106
83e356614c1e DOM Builder now is a navigator like SimpleBuilder
wizard
parents: 104
diff changeset
54 $this->Current->appendChild($node);
83e356614c1e DOM Builder now is a navigator like SimpleBuilder
wizard
parents: 104
diff changeset
55 $this->internalNavigateNodeSet($node);
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
56 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
57
104
196bf443b5e1 DOM::Schema RC0 inflators support, validation and some other things,
wizard
parents: 103
diff changeset
58 if (@errors) {
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
59 $this->BuildErrors->Append(
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
60 map {
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
61 IMPL::DOM::Schema::ValidationError->new(
236
2904da230022 DOM refactoring
sergey
parents: 206
diff changeset
62 node => $node,
2904da230022 DOM refactoring
sergey
parents: 206
diff changeset
63 source => $schemaSource,
2904da230022 DOM refactoring
sergey
parents: 206
diff changeset
64 schema => $schemaNode,
2904da230022 DOM refactoring
sergey
parents: 206
diff changeset
65 message => $schemaNode->messageInflateError,
2904da230022 DOM refactoring
sergey
parents: 206
diff changeset
66 error => $_
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
67 )
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
68 } @errors
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
69 );
104
196bf443b5e1 DOM::Schema RC0 inflators support, validation and some other things,
wizard
parents: 103
diff changeset
70 }
196bf443b5e1 DOM::Schema RC0 inflators support, validation and some other things,
wizard
parents: 103
diff changeset
71
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
72 return $node;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
73 } else {
236
2904da230022 DOM refactoring
sergey
parents: 206
diff changeset
74 die new IMPL::InvalidOperationException("The specified node is undefined", $nodeName)
238
b8c724f6de36 DOM model refactoring
sergey
parents: 236
diff changeset
75 if !$this->ignoreUndefined;
236
2904da230022 DOM refactoring
sergey
parents: 206
diff changeset
76 return;
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
77 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
78 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
79
103
c289ed9662ca Schema beta 2
wizard
parents: 102
diff changeset
80 sub inflateProperties {
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
81 my ($this,$schemaNode,$refProps) = @_;
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
82 my @errors;
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
83 foreach my $schemaProp ( $schemaNode->selectNodes('Property') ) {
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
84 next if not exists $refProps->{$schemaProp->name};
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
85 my $result = eval {$schemaProp->inflateValue($refProps->{$schemaProp->name}) };
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
86 if (my $e = $@) {
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
87 push @errors, $e;
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
88 } else {
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
89 $refProps->{$schemaProp->name} = $result;
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
90 }
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
91 }
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
92 return @errors;
103
c289ed9662ca Schema beta 2
wizard
parents: 102
diff changeset
93 }
c289ed9662ca Schema beta 2
wizard
parents: 102
diff changeset
94
c289ed9662ca Schema beta 2
wizard
parents: 102
diff changeset
95 sub inflateValue {
250
129e48bb5afb DOM refactoring
sergey
parents: 246
diff changeset
96 my ($this,$value,$node,$strict) = @_;
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
97
250
129e48bb5afb DOM refactoring
sergey
parents: 246
diff changeset
98 $strict ||= 0;
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
99 $node ||= $this->Current;
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
100
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
101 my $nodeSchema = $this->{$_schemaNavi}->Current;
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
102
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
103 my $result = eval { $nodeSchema->inflateValue($value) };
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
104 if (my $e=$@) {
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
105 $this->BuildErrors->Append(new IMPL::DOM::Schema::ValidationError(
246
2746a8e5a6c4 Fixed regressions in DOM due previous refactorings
sergey
parents: 238
diff changeset
106 schema => $nodeSchema,
2746a8e5a6c4 Fixed regressions in DOM due previous refactorings
sergey
parents: 238
diff changeset
107 node => $node,
2746a8e5a6c4 Fixed regressions in DOM due previous refactorings
sergey
parents: 238
diff changeset
108 error => $e,
2746a8e5a6c4 Fixed regressions in DOM due previous refactorings
sergey
parents: 238
diff changeset
109 message => $nodeSchema->messageInflateError,
2746a8e5a6c4 Fixed regressions in DOM due previous refactorings
sergey
parents: 238
diff changeset
110 source => $this->{$_schemaNavi}->SourceSchemaNode
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
111 ));
250
129e48bb5afb DOM refactoring
sergey
parents: 246
diff changeset
112 return $strict ? undef : $value ;
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
113 } else {
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
114 return $result;
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
115 }
103
c289ed9662ca Schema beta 2
wizard
parents: 102
diff changeset
116 }
c289ed9662ca Schema beta 2
wizard
parents: 102
diff changeset
117
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
118 sub Back {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
119 my ($this) = @_;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
120
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
121 $this->{$_schemaNavi}->SchemaBack();
106
83e356614c1e DOM Builder now is a navigator like SimpleBuilder
wizard
parents: 104
diff changeset
122 $this->SUPER::Back();
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
123 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
124
112
0ed8e2541b1c Form processing mechanism
wizard
parents: 106
diff changeset
125 sub saveState {
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
126 my ($this) = @_;
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
127
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
128 $this->{$_schemaNavi}->saveState;
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
129 $this->SUPER::saveState;
112
0ed8e2541b1c Form processing mechanism
wizard
parents: 106
diff changeset
130 }
0ed8e2541b1c Form processing mechanism
wizard
parents: 106
diff changeset
131
0ed8e2541b1c Form processing mechanism
wizard
parents: 106
diff changeset
132 sub restoreState {
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
133 my ($this) = @_;
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
134
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
135 $this->{$_schemaNavi}->restoreState;
4d0e1962161c Replaced tabs with spaces
cin
parents: 180
diff changeset
136 $this->SUPER::restoreState;
112
0ed8e2541b1c Form processing mechanism
wizard
parents: 106
diff changeset
137 }
0ed8e2541b1c Form processing mechanism
wizard
parents: 106
diff changeset
138
236
2904da230022 DOM refactoring
sergey
parents: 206
diff changeset
139 #compatibility
2904da230022 DOM refactoring
sergey
parents: 206
diff changeset
140 sub buildErrors {
2904da230022 DOM refactoring
sergey
parents: 206
diff changeset
141 goto &BuildErrors;
2904da230022 DOM refactoring
sergey
parents: 206
diff changeset
142 }
2904da230022 DOM refactoring
sergey
parents: 206
diff changeset
143
250
129e48bb5afb DOM refactoring
sergey
parents: 246
diff changeset
144 sub document {
129e48bb5afb DOM refactoring
sergey
parents: 246
diff changeset
145 goto &Document;
129e48bb5afb DOM refactoring
sergey
parents: 246
diff changeset
146 }
129e48bb5afb DOM refactoring
sergey
parents: 246
diff changeset
147
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
148 1;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
149
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
150 __END__
64
259cd3df6e53 Doc generation
wizard
parents: 49
diff changeset
151
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
152 =pod
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
153
64
259cd3df6e53 Doc generation
wizard
parents: 49
diff changeset
154 =head1 NAME
259cd3df6e53 Doc generation
wizard
parents: 49
diff changeset
155
180
d1676be8afcc Перекодировка в utf-8
sourcer
parents: 165
diff changeset
156 C< IMPL::DOM::Navigator::Builder > - Навигатор, строящий документ по указанной схеме.
64
259cd3df6e53 Doc generation
wizard
parents: 49
diff changeset
157
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
158 =head1 SYNOPSIS
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
159
64
259cd3df6e53 Doc generation
wizard
parents: 49
diff changeset
160 =begin code
259cd3df6e53 Doc generation
wizard
parents: 49
diff changeset
161
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
162 my $builder = new IMPL::DOM::Navigator::Builder(new MyApp::Document,$schema);
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
163 my $reader = new IMPL::DOM::XMLReader(Navigator => $builder);
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
164
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
165 $reader->ParseFile("document.xml");
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
166
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
167 my @errors = $schema->Validate($builder->Document);
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
168
64
259cd3df6e53 Doc generation
wizard
parents: 49
diff changeset
169 =end code
259cd3df6e53 Doc generation
wizard
parents: 49
diff changeset
170
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
171 =head1 DESCRIPTION
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
172
180
d1676be8afcc Перекодировка в utf-8
sourcer
parents: 165
diff changeset
173 Построитель DOM документов по указанной схеме. Обычно используется в связке
d1676be8afcc Перекодировка в utf-8
sourcer
parents: 165
diff changeset
174 с объектами для чтения такими как C<IMPL::DOM::XMLReader>.
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
175
250
129e48bb5afb DOM refactoring
sergey
parents: 246
diff changeset
176 =head1 MEMBERS
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
177
250
129e48bb5afb DOM refactoring
sergey
parents: 246
diff changeset
178 =head2 C< CTOR($classDocument,$schema, %opts) >
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
179
180
d1676be8afcc Перекодировка в utf-8
sourcer
parents: 165
diff changeset
180 Создает новый объект, принимает на вход класс документа (или фабрику, например
d1676be8afcc Перекодировка в utf-8
sourcer
parents: 165
diff changeset
181 L<IMPL::Object::Factory>) и схему. В процессе процедуры построения документа
d1676be8afcc Перекодировка в utf-8
sourcer
parents: 165
diff changeset
182 будет создан объект документа.
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
183
250
129e48bb5afb DOM refactoring
sergey
parents: 246
diff changeset
184 Необязательные именованные параметры
129e48bb5afb DOM refactoring
sergey
parents: 246
diff changeset
185
129e48bb5afb DOM refactoring
sergey
parents: 246
diff changeset
186 =over
129e48bb5afb DOM refactoring
sergey
parents: 246
diff changeset
187
129e48bb5afb DOM refactoring
sergey
parents: 246
diff changeset
188 =item C<ignoreUndefined>
129e48bb5afb DOM refactoring
sergey
parents: 246
diff changeset
189
129e48bb5afb DOM refactoring
sergey
parents: 246
diff changeset
190 C<NavigateCreate> не будет вызывать исключение, если запрашиваемый узел не
129e48bb5afb DOM refactoring
sergey
parents: 246
diff changeset
191 найден в схеме, но будет возвращать C<undef>.
129e48bb5afb DOM refactoring
sergey
parents: 246
diff changeset
192
129e48bb5afb DOM refactoring
sergey
parents: 246
diff changeset
193 =back
129e48bb5afb DOM refactoring
sergey
parents: 246
diff changeset
194
129e48bb5afb DOM refactoring
sergey
parents: 246
diff changeset
195 =head2 C< NavigateCreate($nodeName,%props) >
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
196
180
d1676be8afcc Перекодировка в utf-8
sourcer
parents: 165
diff changeset
197 Создает новый узел с указанным именем и переходит в него. В случае если в схеме
250
129e48bb5afb DOM refactoring
sergey
parents: 246
diff changeset
198 подходящий узел не найден, то вызывается исключение или будет возвращено
129e48bb5afb DOM refactoring
sergey
parents: 246
diff changeset
199 C<undef> см. C<ignoreUndefined>.
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
200
180
d1676be8afcc Перекодировка в utf-8
sourcer
parents: 165
diff changeset
201 При этом по имени узла ищется его схема, после чего определяется класс для
250
129e48bb5afb DOM refactoring
sergey
parents: 246
diff changeset
202 создания экземпляра узла и созданный узел доавляется в документ. При создании
180
d1676be8afcc Перекодировка в utf-8
sourcer
parents: 165
diff changeset
203 нового узла используется метод документа C<< IMPL::DOM::Document->Create >>
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
204
250
129e48bb5afb DOM refactoring
sergey
parents: 246
diff changeset
205 Свойства узла передаются при создании через параметр C<%props>, но имя
129e48bb5afb DOM refactoring
sergey
parents: 246
diff changeset
206 создаваемого узла НЕ может быть переопределено свойством C<nodeName>, оно будет
129e48bb5afb DOM refactoring
sergey
parents: 246
diff changeset
207 проигнорировано.
64
259cd3df6e53 Doc generation
wizard
parents: 49
diff changeset
208
250
129e48bb5afb DOM refactoring
sergey
parents: 246
diff changeset
209 Свойства узла будут преобразованы при помощи заданных в схеме заполнителей
129e48bb5afb DOM refactoring
sergey
parents: 246
diff changeset
210 C<inflator>.
129e48bb5afb DOM refactoring
sergey
parents: 246
diff changeset
211
129e48bb5afb DOM refactoring
sergey
parents: 246
diff changeset
212 =head2 C<[get]document >
64
259cd3df6e53 Doc generation
wizard
parents: 49
diff changeset
213
180
d1676be8afcc Перекодировка в utf-8
sourcer
parents: 165
diff changeset
214 Свойство, которое содержит документ по окончании процедуры построения.
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
215
250
129e48bb5afb DOM refactoring
sergey
parents: 246
diff changeset
216 =head2 C<[get]buildErrors>
129e48bb5afb DOM refactoring
sergey
parents: 246
diff changeset
217
129e48bb5afb DOM refactoring
sergey
parents: 246
diff changeset
218 Ошибки, возникшие в процессе построения документа.
129e48bb5afb DOM refactoring
sergey
parents: 246
diff changeset
219
129e48bb5afb DOM refactoring
sergey
parents: 246
diff changeset
220 =head2 C<[get]ignoreUndefined>
129e48bb5afb DOM refactoring
sergey
parents: 246
diff changeset
221
129e48bb5afb DOM refactoring
sergey
parents: 246
diff changeset
222 Опция, заданная при создании построителя, отвечающая за обработку узлов
129e48bb5afb DOM refactoring
sergey
parents: 246
diff changeset
223 не найденных в схеме.
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
224
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 35
diff changeset
225 =cut