155 |
|
{ |
156 |
|
push(@{$self->{textcontent}->{$self->currentenv_()}},@_); |
157 |
|
} |
158 |
+ |
else |
159 |
+ |
{ |
160 |
+ |
$self->{textcontent}->{$self->currentenv_()} = [ @_ ]; |
161 |
+ |
} |
162 |
|
} |
163 |
|
|
164 |
|
sub data_() |
177 |
|
{ |
178 |
|
if (exists($self->{leveldata_}->{$self->{activelevel}-1}->{$self->parentenv_()}->{$current}->{'content'})) |
179 |
|
{ |
180 |
+ |
# For all nested tags with "content" as a key, the first value for content will |
181 |
+ |
# be the destination of the text (i.e. STDOUT or file:x). Store this destination |
182 |
+ |
# as a key "dest": |
183 |
+ |
$self->{leveldata_}->{$self->{activelevel}-1}->{$self->parentenv_()}->{$current}->{'dest'} = |
184 |
+ |
$self->{leveldata_}->{$self->{activelevel}-1}->{$self->parentenv_()}->{$current}->{'content'},"\n"; |
185 |
+ |
# Now just overwrite previsou value with the text: |
186 |
|
$self->{leveldata_}->{$self->{activelevel}-1}->{$self->parentenv_()}->{$current}->{'content'} = |
187 |
|
$self->{textcontent}->{$current}; |
188 |
|
} |
189 |
|
elsif ($self->{content}->{$current}->{'content'}) |
190 |
|
{ |
191 |
+ |
$self->{content}->{$current}->{'dest'} = $self->{content}->{$current}->{'content'}; |
192 |
|
$self->{content}->{$current}->{'content'} = $self->{textcontent}->{$current}; |
193 |
|
} |
194 |
|
|
199 |
|
sub AUTOLOAD() |
200 |
|
{ |
201 |
|
my $self=shift; |
202 |
< |
my ($attributes)=@_; |
192 |
< |
|
202 |
> |
my ($attributes)=@_; |
203 |
|
return if $AUTOLOAD =~ /::DESTROY$/; |
204 |
|
my $name=$AUTOLOAD; |
205 |
|
$name =~ s/.*://; |
206 |
< |
|
206 |
> |
$self->store_($name, $attributes); |
207 |
> |
} |
208 |
> |
|
209 |
> |
sub store_() |
210 |
> |
{ |
211 |
> |
my $self=shift; |
212 |
> |
my ($name,$attributes)=@_; |
213 |
> |
|
214 |
|
if (exists($self->{leveldata_}->{$self->{activelevel}})) |
215 |
|
{ |
216 |
|
$self->{leveldata_}->{$self->{activelevel}}->{$name} = $attributes; |
218 |
|
else |
219 |
|
{ |
220 |
|
$self->{leveldata_}->{$self->{activelevel}} = { $name => $attributes }; |
221 |
< |
} |
221 |
> |
} |
222 |
|
} |
223 |
|
|
224 |
|
sub DESTROY() |