annotate Lib/IMPL/DOM/Navigator/Builder.pm @ 273:ad93c9f4dd93

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