xml-axkit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject cvs commit: xml-axkit/lib/Apache/AxKit/Language AxPoint.pm
Date Fri, 22 Mar 2002 07:24:31 GMT
matts       02/03/21 23:24:31

  Modified:    lib/Apache/AxKit/Language AxPoint.pm
  Log:
  Fixed case where AxPoint was used in a pipeline, instead of on its own.
  
  Revision  Changes    Path
  1.4       +29 -9     xml-axkit/lib/Apache/AxKit/Language/AxPoint.pm
  
  Index: AxPoint.pm
  ===================================================================
  RCS file: /home/cvs/xml-axkit/lib/Apache/AxKit/Language/AxPoint.pm,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AxPoint.pm	21 Mar 2002 23:23:59 -0000	1.3
  +++ AxPoint.pm	22 Mar 2002 07:24:31 -0000	1.4
  @@ -1,4 +1,4 @@
  -# $Id: AxPoint.pm,v 1.3 2002/03/21 23:23:59 matts Exp $
  +# $Id: AxPoint.pm,v 1.4 2002/03/22 07:24:31 matts Exp $
   
   package Apache::AxKit::Language::AxPoint;
   
  @@ -22,6 +22,18 @@
   
       my $output_handler = Apache::AxKit::Language::AxPoint::Output->new($r);
       
  +    my ($xmlstring);
  +    
  +    if (my $dom = $r->pnotes('dom_tree')) {
  +        $xmlstring = $dom->toString;
  +        delete $r->pnotes()->{'dom_tree'};
  +    }
  +    else {
  +        $xmlstring = $r->pnotes('xml_string');
  +    }
  +
  +    AxKit::Debug(5, "AxPoint: creating parser and handler");
  +    
       my $parser = XML::SAX::ParserFactory->parser(
           Handler =>
               XML::Handler::AxPoint->new(
  @@ -30,15 +42,23 @@
               )
       );
   
  -    eval {
  -        my $fh = $xml_provider->get_fh();
  -        $parser->parse_fh($fh, 
  -            { Source => { SystemId => $xml_provider->key } });
  -    };
  -    if ($@) {
  -        my $str = $xml_provider->get_strref();
  -        $parser->parse_string($$str,
  +    AxKit::Debug(5, "AxPoint: Parsing XML");
  +
  +    if (length($xmlstring)) {
  +        $parser->parse_string($xmlstring,
               { Source => { SystemId => $xml_provider->key } });
  +    }
  +    else {
  +       eval {
  +           my $fh = $xml_provider->get_fh();
  +            parser->parse_fh($fh, 
  +                 Source => { SystemId => $xml_provider->key } });
  +        };
  +        if ($@) {
  +            my $str = $xml_provider->get_strref();
  +            $parser->parse_string($$str,
  +                { Source => { SystemId => $xml_provider->key } });
  +        }
       }
   
       AxKit::Debug(7, "AxPoint: outputting pdf");
  
  
  

Mime
View raw message