20 |
|
# includeparse(local_parsename, objparsename, activedoc) : copy the parse from |
21 |
|
# one object to another |
22 |
|
# currentparsename([name]) : get/set current parse name |
23 |
– |
# newdoc(file) : Return an new object of the appropriate type |
23 |
|
# getfile(url) : get a processedfile object given a url |
24 |
|
# activatedoc(url) : Return the object ref for a doc described by the given url |
25 |
|
# -- any parse called "init" will also be run |
65 |
|
$self->copydocquery($basedoc); |
66 |
|
} |
67 |
|
else { |
68 |
< |
$self->error("Error : No base doc found"); |
68 |
> |
$self->error("ActiveDoc Error : No base doc found"); |
69 |
|
} |
70 |
|
} |
71 |
|
$self->_init2(); |
184 |
|
my $self=shift; |
185 |
|
my $ActiveDoc=shift; |
186 |
|
|
187 |
< |
$self->basequery($ActiveDoc->basequery()); |
187 |
> |
if ( defined $ActiveDoc->basequery() ) { |
188 |
> |
$self->basequery($ActiveDoc->basequery()); |
189 |
> |
} |
190 |
> |
else { |
191 |
> |
$self->error("Cannot copy basequery - undefined"); |
192 |
> |
} |
193 |
|
} |
194 |
|
|
195 |
|
sub config { |
202 |
|
my $self=shift; |
203 |
|
@_ ? $self->{Query}=shift |
204 |
|
: $self->{Query}; |
205 |
+ |
return $self->{Query}; |
206 |
|
} |
207 |
|
|
208 |
|
sub option { |
269 |
|
|
270 |
|
# now parse it for the <DocType> tag |
271 |
|
my $tempdoc=ActiveDoc::ActiveDoc->new($self->config()); |
272 |
< |
$tempdoc->url($url); |
272 |
> |
$tempdoc->{urlhandler}=$self->{urlhandler}; |
273 |
> |
my $fullurl=$tempdoc->url($url); |
274 |
> |
$url=$fullurl; |
275 |
|
$tempdoc->{doctypefound}=0; |
276 |
|
$tempdoc->newparse("doctype"); |
277 |
|
$tempdoc->addtag("doctype","Doc", \&Doc_Start, $tempdoc, |
310 |
|
my $self=shift; |
311 |
|
my $string=shift; |
312 |
|
|
313 |
< |
($line, $file)=$self->line(); |
314 |
< |
print "Parse Error in ".$file->url().", line ". |
313 |
> |
if ( ! defined $self->{currentparse} ) { |
314 |
> |
$self->error($string); |
315 |
> |
} |
316 |
> |
else { |
317 |
> |
($line, $file)=$self->line(); |
318 |
> |
print "Parse Error in ".$file->url().", line ". |
319 |
|
$line."\n"; |
320 |
< |
print $string."\n"; |
321 |
< |
die; |
320 |
> |
print $string."\n"; |
321 |
> |
die; |
322 |
> |
} |
323 |
|
} |
324 |
|
|
325 |
|
sub checktag { |
375 |
|
# Keep track of base tags |
376 |
|
push @{$self->{basestack}}, $$hashref{"type"}; |
377 |
|
# Set the base |
366 |
– |
print "BASE SET for ".$$hashref{"type"}."\n"; |
378 |
|
$self->{urlhandler}->setbase($$hashref{"type"},$hashref); |
368 |
– |
print "BASE SET for ".$$hashref{"type"}."\n"; |
369 |
– |
|
379 |
|
} |
380 |
|
|
381 |
|
sub Base_end { |
384 |
|
my $type; |
385 |
|
|
386 |
|
if ( $#{$self->{basestack}} == -1 ) { |
387 |
< |
print "Parse Error : unmatched </".$name."> on line ". |
379 |
< |
$self->line()."\n"; |
380 |
< |
die; |
387 |
> |
$self->parseerror("Parse Error : unmatched </$name>"); |
388 |
|
} |
389 |
|
else { |
390 |
|
$type = pop @{$self->{basestack}}; |