ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/ActiveDoc/ActiveDoc.pm
(Generate patch)

Comparing COMP/SCRAM/src/ActiveDoc/ActiveDoc.pm (file contents):
Revision 1.16 by williamc, Thu Jan 20 18:40:39 2000 UTC vs.
Revision 1.19 by williamc, Thu Jan 27 17:50:38 2000 UTC

# Line 20 | Line 20
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
# Line 66 | Line 65 | sub new {
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();
# Line 185 | Line 184 | sub copydocquery {
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 {
# Line 198 | Line 202 | sub basequery {
202          my $self=shift;
203          @_ ? $self->{Query}=shift
204             : $self->{Query};
205 +        return $self->{Query};
206   }
207  
208   sub option {
# Line 265 | Line 270 | sub activatedoc {
270          # now parse it for the <DocType> tag
271          my $tempdoc=ActiveDoc::ActiveDoc->new($self->config());
272          $tempdoc->{urlhandler}=$self->{urlhandler};
273 <        $tempdoc->url($url);
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,
# Line 304 | Line 310 | sub parseerror {
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 {
# Line 373 | Line 384 | sub Base_end {
384          my $type;
385  
386          if ( $#{$self->{basestack}} == -1 ) {
387 <                print "Parse Error : unmatched </".$name."> on line ".
377 <                        $self->line()."\n";
378 <                die;
387 >                $self->parseerror("Parse Error : unmatched </$name>");
388          }
389          else {
390            $type = pop @{$self->{basestack}};

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines