annotate Lib/IMPL/DOM/Navigator/Builder.pm @ 373:3ca44e23fd1f

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