You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axkit-dev@xml.apache.org by ki...@apache.org on 2002/05/13 21:33:28 UTC

cvs commit: xml-axkit/lib/Apache/AxKit/Provider File.pm

kip         02/05/13 12:33:28

  Modified:    .        AxKit.xs Changes MANIFEST axconfig.c axconfig.h
               lib      AxKit.pm
               lib/Apache/AxKit ConfigReader.pm Provider.pm
               lib/Apache/AxKit/Language LibXSLT.pm
               lib/Apache/AxKit/Provider File.pm
  Added:       lib/Apache/AxKit/Language SAXMachines.pm
  Log:
  Seperated ContentProviders from StyleProviders, added SAXMachines Language module.
  
  Revision  Changes    Path
  1.3       +2 -2      xml-axkit/AxKit.xs
  
  Index: AxKit.xs
  ===================================================================
  RCS file: /home/cvs/xml-axkit/AxKit.xs,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AxKit.xs	3 May 2002 15:13:44 -0000	1.2
  +++ AxKit.xs	13 May 2002 19:33:28 -0000	1.3
  @@ -1,4 +1,4 @@
  -/* $Id: AxKit.xs,v 1.2 2002/05/03 15:13:44 matts Exp $ */
  +/* $Id: AxKit.xs,v 1.3 2002/05/13 19:33:28 kip Exp $ */
   
   #ifdef __cplusplus
   extern "C" {
  @@ -252,7 +252,7 @@
               av_push(item_store, ST(item_id));
           }
           
  -        if (alternate = call_method_sv(perl_get_sv("AxKit::Cfg", FALSE), "ProviderClass")) {
  +        if (alternate = call_method_sv(perl_get_sv("AxKit::Cfg", FALSE), "ContentProviderClass")) {
               SV * tmp;
               sv_bless(obj, gv_stashsv(alternate, 0));
               SvREFCNT_dec(alternate);
  
  
  
  1.7       +4 -0      xml-axkit/Changes
  
  Index: Changes
  ===================================================================
  RCS file: /home/cvs/xml-axkit/Changes,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Changes	23 Apr 2002 19:31:18 -0000	1.6
  +++ Changes	13 May 2002 19:33:28 -0000	1.7
  @@ -1,5 +1,9 @@
   AxKit Changes
   
  +1.5.2-dev
  + - Added SAXMachines Language module.
  + - Seperated ContentProviders from StyleProviders
  +
   1.5.2
    - Allow AxKit to handle directory requests.
    - Fixed all Language modules to return 200/OK
  
  
  
  1.8       +1 -0      xml-axkit/MANIFEST
  
  Index: MANIFEST
  ===================================================================
  RCS file: /home/cvs/xml-axkit/MANIFEST,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- MANIFEST	22 Apr 2002 12:51:14 -0000	1.7
  +++ MANIFEST	13 May 2002 19:33:28 -0000	1.8
  @@ -140,6 +140,7 @@
   lib/Apache/AxKit/Language/XMLNewsNITF.pm
   lib/Apache/AxKit/Language/XMLNewsRDF.pm
   lib/Apache/AxKit/Language/XPathScript.pm
  +lib/Apache/AxKit/Language/SAXMachines.pm
   lib/Apache/AxKit/Language/XSP.pm
   lib/Apache/AxKit/Language/XSP/SimpleTaglib.pm
   lib/Apache/AxKit/Language/XSP/TaglibHelper.pm
  
  
  
  1.4       +23 -17    xml-axkit/axconfig.c
  
  Index: axconfig.c
  ===================================================================
  RCS file: /home/cvs/xml-axkit/axconfig.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- axconfig.c	8 May 2002 12:35:09 -0000	1.3
  +++ axconfig.c	13 May 2002 19:33:28 -0000	1.4
  @@ -1,4 +1,4 @@
  -/* $Id: axconfig.c,v 1.3 2002/05/08 12:35:09 matts Exp $ */
  +/* $Id: axconfig.c,v 1.4 2002/05/13 19:33:28 kip Exp $ */
   
   #ifndef WIN32
   #include <modules/perl/mod_perl.h>
  @@ -101,7 +101,7 @@
   
       new->cache_dir = 0;
       new->config_reader_module = 0;
  -    new->provider_module = 0;
  +    new->contentprovider_module = 0;
       new->styleprovider_module = 0;
       new->default_style = 0;
       new->default_media = 0;
  @@ -129,7 +129,8 @@
           "new.reset_processors: %d\n"
           "new.cache_dir: %d\n"
           "new.config_reader_module: %d\n"
  -        "new.provider_module: %d\n"
  +        "new.contentprovider_module: %d\n"
  +        "new.styleprovider_module: %d\n"
           "new.default_style: %d\n"
           "new.default_media: %d\n"
           "new.cache_module: %d\n"
  @@ -152,7 +153,8 @@
           new->reset_processors,
           new->cache_dir,
           new->config_reader_module,
  -        new->provider_module,
  +        new->contentprovider_module,
  +        new->styleprovider_module,
           new->default_style,
           new->default_media,
           new->cache_module,
  @@ -279,7 +281,8 @@
           "parent_dir.reset_processors: %d\n"
           "parent_dir.cache_dir: %d\n"
           "parent_dir.config_reader_module: %d\n"
  -        "parent_dir.provider_module: %d\n"
  +        "parent_dir.contentprovider_module: %d\n"
  +        "parent_dir.styleprovider_module: %d\n"
           "parent_dir.default_style: %d\n"
           "parent_dir.default_media: %d\n"
           "parent_dir.cache_module: %d\n"
  @@ -302,7 +305,8 @@
           parent_dir->reset_processors,
           parent_dir->cache_dir,
           parent_dir->config_reader_module,
  -        parent_dir->provider_module,
  +        parent_dir->contentprovider_module,
  +        parent_dir->styleprovider_module,
           parent_dir->default_style,
           parent_dir->default_media,
           parent_dir->cache_module,
  @@ -327,7 +331,8 @@
           "subdir.reset_processors: %d\n"
           "subdir.cache_dir: %d\n"
           "subdir.config_reader_module: %d\n"
  -        "subdir.provider_module: %d\n"
  +        "subdir.contentprovider_module: %d\n"
  +        "subdir.styleprovider_module: %d\n"
           "subdir.default_style: %d\n"
           "subdir.default_media: %d\n"
           "subdir.cache_module: %d\n"
  @@ -350,7 +355,8 @@
           subdir->reset_processors,
           subdir->cache_dir,
           subdir->config_reader_module,
  -        subdir->provider_module,
  +        subdir->contentprovider_module,
  +        subdir->styleprovider_module,
           subdir->default_style,
           subdir->default_media,
           subdir->cache_module,
  @@ -382,11 +388,11 @@
           new->config_reader_module = ap_pstrdup(p, parent_dir->config_reader_module);
       }
       
  -    if (subdir->provider_module) {
  -        new->provider_module = ap_pstrdup(p, subdir->provider_module);
  +    if (subdir->contentprovider_module) {
  +        new->contentprovider_module = ap_pstrdup(p, subdir->contentprovider_module);
       }
  -    else if (parent_dir->provider_module) {
  -        new->provider_module = ap_pstrdup(p, parent_dir->provider_module);
  +    else if (parent_dir->contentprovider_module) {
  +        new->contentprovider_module = ap_pstrdup(p, parent_dir->contentprovider_module);
       }
       
       if (subdir->styleprovider_module) {
  @@ -1123,8 +1129,8 @@
         OR_ALL, TAKE1,
         "alternative module to use for reading configuration" },
   
  -    { "AxProvider", ax_set_module_slot,
  -      (void *)XtOffsetOf(axkit_dir_config, provider_module),
  +    { "AxContentProvider", ax_set_module_slot,
  +      (void *)XtOffsetOf(axkit_dir_config, contentprovider_module),
         OR_ALL, TAKE1,
         "alternative module to use for reading the xml" },
   
  @@ -1267,9 +1273,9 @@
           hv_store(retval, "ConfigReader",
                   12, (newSVpv(cfg->config_reader_module, 0)), 0);
       }
  -    if (cfg->provider_module) {
  -        hv_store(retval, "Provider",
  -                8, (newSVpv(cfg->provider_module, 0)), 0);
  +    if (cfg->contentprovider_module) {
  +        hv_store(retval, "ContentProvider",
  +                15, (newSVpv(cfg->contentprovider_module, 0)), 0);
       }
       if (cfg->styleprovider_module) {
           hv_store(retval, "StyleProvider",
  
  
  
  1.3       +2 -2      xml-axkit/axconfig.h
  
  Index: axconfig.h
  ===================================================================
  RCS file: /home/cvs/xml-axkit/axconfig.h,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- axconfig.h	2 Apr 2002 16:27:53 -0000	1.2
  +++ axconfig.h	13 May 2002 19:33:28 -0000	1.3
  @@ -1,4 +1,4 @@
  -/* $Id: axconfig.h,v 1.2 2002/04/02 16:27:53 matts Exp $ */
  +/* $Id: axconfig.h,v 1.3 2002/05/13 19:33:28 kip Exp $ */
   
   #ifdef WIN32
   #define _INC_DIRENT
  @@ -35,7 +35,7 @@
       /* simple types */
       char * cache_dir;
       char * config_reader_module;
  -    char * provider_module;
  +    char * contentprovider_module;
       char * styleprovider_module;
       char * default_style;
       char * default_media;
  
  
  
  1.8       +11 -7     xml-axkit/lib/AxKit.pm
  
  Index: AxKit.pm
  ===================================================================
  RCS file: /home/cvs/xml-axkit/lib/AxKit.pm,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- AxKit.pm	22 Apr 2002 12:42:36 -0000	1.7
  +++ AxKit.pm	13 May 2002 19:33:28 -0000	1.8
  @@ -1,4 +1,4 @@
  -# $Id: AxKit.pm,v 1.7 2002/04/22 12:42:36 matts Exp $
  +# $Id: AxKit.pm,v 1.8 2002/05/13 19:33:28 kip Exp $
   
   package AxKit;
   use strict;
  @@ -155,7 +155,7 @@
           return $plugin_ret;
       }
   
  -    my $provider = Apache::AxKit::Provider->new($r);
  +    my $provider = Apache::AxKit::Provider->new_content_provider($r);
   
       return $provider->decline(reason => "passthru set")
               if $r->notes('axkit_passthru');
  @@ -205,7 +205,7 @@
           return $plugin_ret;
       }
   
  -    my $provider = Apache::AxKit::Provider->new($r);
  +    my $provider = Apache::AxKit::Provider->new_content_provider($r);
   
       return $provider->decline(reason => "passthru set")
               if $r->notes('axkit_passthru');
  @@ -494,7 +494,8 @@
   
       while (@$styles) {
           my $style = shift @$styles;
  -        my $styleprovider = Apache::AxKit::Provider->new(
  +
  +        my $styleprovider = Apache::AxKit::Provider->new_style_provider(
                   $r,
                   uri => $style->{href},
                   );
  @@ -1286,15 +1287,18 @@
   to load in place of the default. They are:
   
       AxConfigReader
  -    AxProvider
  +    AxContentProvider
  +    AxStyleProvider
       AxCacheModule
   
   The ConfigReader module returns information about various configuration
   options. Currently it takes most of its information from the above
   mentioned configuration directives, or from PerlSetVar.
   
  -The Provider module is the means by which AxKit gets its resources from.
  -The default Provider simply picks up files from the filesystem, but
  +The Provider modules are the means by which AxKit gets its resources from.
  +ContentProviders deliver up the document to be processed, while StyleProviders
  +are used to get the data for any stylesheets that will be applied.
  +The default Provider for each simply picks up files from the filesystem, but
   alternate providers could pull the information from a DBMS, or perhaps
   create some XML structure for directories. There currently exists one
   alternate Provider module, which allows AxKit to work as a recipient
  
  
  
  1.3       +4 -4      xml-axkit/lib/Apache/AxKit/ConfigReader.pm
  
  Index: ConfigReader.pm
  ===================================================================
  RCS file: /home/cvs/xml-axkit/lib/Apache/AxKit/ConfigReader.pm,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ConfigReader.pm	2 Apr 2002 16:27:54 -0000	1.2
  +++ ConfigReader.pm	13 May 2002 19:33:28 -0000	1.3
  @@ -1,4 +1,4 @@
  -# $Id: ConfigReader.pm,v 1.2 2002/04/02 16:27:54 matts Exp $
  +# $Id: ConfigReader.pm,v 1.3 2002/05/13 19:33:28 kip Exp $
   
   package Apache::AxKit::ConfigReader;
   
  @@ -57,10 +57,10 @@
       return $dir . "/.xmlstyle_cache";
   }
   
  -sub ProviderClass {
  +sub ContentProviderClass {
       my $self = shift;
  -    if (my $alternate = $self->{cfg}{Provider} || 
  -            $self->{apache}->dir_config('AxProvider')) {
  +    if (my $alternate = $self->{cfg}{ContentProvider} || 
  +            $self->{apache}->dir_config('AxContentProvider')) {
           return $alternate;
       }
       
  
  
  
  1.5       +40 -9     xml-axkit/lib/Apache/AxKit/Provider.pm
  
  Index: Provider.pm
  ===================================================================
  RCS file: /home/cvs/xml-axkit/lib/Apache/AxKit/Provider.pm,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Provider.pm	2 Apr 2002 16:27:54 -0000	1.4
  +++ Provider.pm	13 May 2002 19:33:28 -0000	1.5
  @@ -1,4 +1,4 @@
  -# $Id: Provider.pm,v 1.4 2002/04/02 16:27:54 matts Exp $
  +# $Id: Provider.pm,v 1.5 2002/05/13 19:33:28 kip Exp $
   
   package Apache::AxKit::Provider;
   use strict;
  @@ -9,12 +9,30 @@
   
   # use vars qw/$COUNT/;
   
  -sub new {
  +sub new_style_provider {
  +    my $class = shift;
  +    my $apache = shift;
  +    my $self = bless { apache => $apache }, $class;
  +    
  +    if (my $alternate = $AxKit::Cfg->StyleProviderClass()) {
  +        AxKit::Debug(7, "Style Provider Override: $alternate" );
  +        AxKit::reconsecrate($self, $alternate);
  +    }
  +    
  +    $self->init(@_);
  +    
  +    AxKit::add_depends($self->key());
  +
  +    return $self;
  +}
  +
  +sub new_content_provider {
       my $class = shift;
       my $apache = shift;
       my $self = bless { apache => $apache }, $class;
       
  -    if (my $alternate = $AxKit::Cfg->ProviderClass()) {
  +    if (my $alternate = $AxKit::Cfg->ContentProviderClass()) {
  +        AxKit::Debug(7, "Content Provider Override: $alternate" );
           AxKit::reconsecrate($self, $alternate);
       }
       
  @@ -25,6 +43,10 @@
       return $self;
   }
   
  +sub new {
  +    return new_content_provider( @_ );
  +}
  +
   sub init {
       # blank - override to provide functionality
   }
  @@ -413,18 +435,27 @@
   
   =head1 SYNOPSIS
   
  -Override the base Provider class and enable it using:
  +Override the base ContentProvider class and enable it using:
  +
  +    AxContentProvider MyClass
  +    
  +    # alternatively use:
  +    # PerlSetVar AxContentProvider MyClass
  +
  +Override the base StyleProvider class and enable it using:
   
  -    AxProvider MyClass
  +    AxStyleProvider MyClass
       
       # alternatively use:
  -    # PerlSetVar AxProvider MyClass
  +    # PerlSetVar AxStyleProvider MyClass
   
   =head1 DESCRIPTION
   
  -The Provider class is used to read in the data source for the given URL.
  -The default Provider is Provider::File, which reads from the filesystem,
  -although obviously you can read from just about anywhere.
  +The Provider class is used to read in the data sources for the given URL.
  +The ContentProvider handles the task of returning the data for the XML source
  +document, while the StyleProvider fetches the data for any stylesheets that
  +will be applied to that source document. The default for each is Provider::File, 
  +which reads from the filesystem, although obviously you can read from just about anywhere.
   
   Should you wish to override the default Provider, these are the methods
   you need to implement:
  
  
  
  1.8       +3 -3      xml-axkit/lib/Apache/AxKit/Language/LibXSLT.pm
  
  Index: LibXSLT.pm
  ===================================================================
  RCS file: /home/cvs/xml-axkit/lib/Apache/AxKit/Language/LibXSLT.pm,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- LibXSLT.pm	22 Apr 2002 13:06:39 -0000	1.7
  +++ LibXSLT.pm	13 May 2002 19:33:28 -0000	1.8
  @@ -1,4 +1,4 @@
  -# $Id: LibXSLT.pm,v 1.7 2002/04/22 13:06:39 jwalt Exp $
  +# $Id: LibXSLT.pm,v 1.8 2002/05/13 19:33:28 kip Exp $
   
   package Apache::AxKit::Language::LibXSLT;
   
  @@ -76,7 +76,7 @@
           my $changed = 0;
           DEPENDS:
           foreach my $depends (@{ $cache->{depends} }) {
  -            my $p = Apache::AxKit::Provider->new($r, key => $depends);
  +            my $p = Apache::AxKit::Provider->new_style_provider($r, key => $depends);
               if ( $p->has_changed( $cache->{mtime} ) ) {
                   $changed = 1;
                   last DEPENDS;
  @@ -150,7 +150,7 @@
   sub open_uri {
       my $uri = shift || './';
       AxKit::Debug(8, "LibXSLT open_uri: $uri");
  -    my $provider = Apache::AxKit::Provider->new(
  +    my $provider = Apache::AxKit::Provider->new_style_provider(
           AxKit::Apache->request(),
           uri => $uri,
           );
  
  
  
  1.1                  xml-axkit/lib/Apache/AxKit/Language/SAXMachines.pm
  
  Index: SAXMachines.pm
  ===================================================================
  package Apache::AxKit::Language::SAXMachines;
  
  use strict;
  use vars qw/@ISA $VERSION/;
  use XML::SAX::Machines qw( Pipeline );
  use XML::LibXML::SAX::Builder;
  use Apache;
  use Apache::Request;
  use Apache::AxKit::Language;
  
  @ISA = 'Apache::AxKit::Language';
  
  $VERSION = 1.0; # this fixes a CPAN.pm bug. Bah!
  
  sub handler {
      my $class = shift;
      my ($r, $xml, $style, $last_in_chain) = @_;
      
      my ($xmlstring, $xml_doc);
      
      AxKit::Debug(7, "[SAXMachines] getting the XML");
      
      if (my $dom = $r->pnotes('dom_tree')) {
          $xml_doc = $dom;
          delete $r->pnotes()->{'dom_tree'};
      }
      else {
          $xmlstring = $r->pnotes('xml_string');
      }
    
      my $machine_class;
      my @machine_spec = split /\s+/, $r->dir_config('AxSAXMachineFilters');
  
      if ( length( $r->dir_config('AxSAXMachineClass') ) ) {
          my $mclass = $r->dir_config('AxSAXMachineClass');
          eval "require $mclass";
          my $machine_object = $mclass->new();
          $machine_class     = $machine_object->get_machine( $r, $xml, $last_in_chain );
      }
    
      unshift @machine_spec, $machine_class if ref( $machine_class );
  
      AxKit::Debug(7, "[SAXMachines] Filters: @machine_spec");
  
      my $dom_builder = XML::LibXML::SAX::Builder->new();
      my $pipeline = Pipeline( @machine_spec, $dom_builder );
  
  
      # here's the beef...
      my ($result, $error);
  
      AxKit::Debug(7, "[SAXMachines] parsing document");
  
      if ( $xml_doc ) {
          AxKit::Debug(10, "[SAXMachines] generating events from DOM tree");
          my $p = XML::LibXML::SAX::Parser->new( Handler => $pipeline );
          eval {
              $result = $p->generate( $xml_doc );
          };
          $error = $@ if $@;
      }
      elsif ($xmlstring) {
          AxKit::Debug(10, "[SAXMachines] generating events from XML string");
          eval {
              $result = $pipeline->parse_string($xmlstring, $r->uri());
          };
          $error = $@ if $@;
      }
      if (!$xml_doc && !$xmlstring) {
          eval {
              my $fh = $xml->get_fh();
              $result = $pipeline->parse_fh($fh, $r->uri());
          };
          if ($@) {
              $xmlstring = ${$xml->get_strref()};
              eval {
                  $result = $pipeline->parse_string( $xmlstring );
              };
              $error = $@ if $@;
          }
      } 
  
      if ( length( $error ) ) {
          throw Apache::AxKit::Exception::Error(
                      -text => "SAXMachines Error: $error"
                      );
      }
  
      AxKit::Debug(7, "[SAXMachines] parse complete, returning DOM tree");
  
      $r->pnotes('dom_tree', $result);
      return Apache::Constants::OK;
  
  }
  
  1;
  
  __END__
  =pod
  
  =head1 NAME
  
  Apache::AxKit::Language::SAXMachines - Transform Content With SAX Filters
  
  =head1 SYNOPSIS
      
      # add the style processor mapping
      AxAddStyleMap application/x-saxmachines Apache::AxKit::Language::SAXMachines
  
      # add the processor
      AxAddProcessor application/x-saxmachines .
  
      # create a simple filter chain
      PerlSetVar AxSAXMachineFilters "XML::Filter1 XML::Filter2"
  
      # filter set-up via a controller class
      PerlSetVar AxSAXMachineClass "Custom::MachineBuilderClass"
  
  =head1 DESCRIPTION
  
  Language::SAXMachines provides an easy way ( via Barrie Slaymaker's
  XML::SAX::Machines ) to use SAX filter chains to transform XML content.
  
  It is not technically a "language" in the same sense that XSP, XPathScript, or
  XSLT are since there is no stylesheet to write or process. Instead, the SAX
  filters are added via config directives in your .htaccess or *.conf file. 
  
  ( Note, future versions may add an associated XML application grammar that 
  may be used to define/configure the filter chain, but rushing forward to that is 
  Truly Bad Idea(tm) for a number of reasons ).
  
  The configuration directives that are required or recognized by Language::SAXMachines
  are detailed below.
  
  =head2 Style Processor Mapping (AxAddStyleMap)
  
  To use Language::SAXMachines you must set set up the mapping between
  the style processor's MIME type and the Language::SAXMachines module.
  This is achieved via the typical AxAddStyleMap directive:
  
      AxAddStyleMap application/x-saxmachines Apache::AxKit::Language::SAXMachines
  
  =head2 Invoking The Processor (AxAddProcessor, etc.)
  
  To apply Language::SAXMachines processor to a given document request, you must use
  the AxAddProcessor directive (or one of its relations): 
  
      <Files *.xml>
        AxAddProcessor application/x-saxmachines .
      </Files>
  
  Note the dot ('.') there. Like XSP, there is no external stylesheet to
  process so the URI must be set to point back to the document itself.
  
  See the section labeled "ASSOCIATING STYLESHEETS WITH XML FILES" in the 
  main AxKit POD ( perldoc AxKit ) for additional options.
  
  =head2 Setting Up a Simple SAX Filter Chain (AxSAXMachineFilters)
  
  For simple cases where you want to process the document through 
  a static list of SAX filters, use the AxSAXMachineFilters option. It
  accepts a white-space-seperated list of valid SAX Filter module names and
  builds a linear processing pipeline from those modules. Filters are applied
  in the same order that they appear in the AxSAXMachineFilters directive.
  
  The following would create a simple pipleline that applies the SAX filters 
  XML::Filter1 and XML::Filter2 (in that order) to the document.
  
      PerlSetVar AxSAXMachineFilters "XML::Filter1 XML::Filter2"
  
  =head2 Using a SAX::Machines-aware Controller Class (AxSAXMachineClass)
  
  A static list of SAX Filters is fine for many tasks. However, for more advanced
  applications, it is often desireable for sets of filters (or other SAX::Machines)
  to be dynamically chosen and set up at request time. 
  
  The AxSAXMachinesClass directive accpets the module name of a class that is 
  capable of building a SAX::Machines processing chain. The object returned
  from that module's get_machine() method is expected to a blessed and valid
  reference to to a SAX::Machine object (including Pipelines, ByRecords, etc.).
  
  The following would use the SAX::Machines object returned by the
  get_machine() method of the the Custom::MachineBuilderClass module to
  create the SAX processing chain.
  
      PerlSetVar AxSAXMachineClass "Custom::MachineBuilderClass"
  
  In addition, the get_machines() method in the class defined by the AxSAXMachineClass
  directive is passed a reference to the current Apache::Request instance (as well as 
  few other possibly useful bits of information) allowing the module to create a processing
  chain that is more directly responsive to the context of the current request. A typical
  get_machine() implementation might start off like:
  
     sub get_machine {
         my ($self, $r, $last_in_chain) = @_;
  
         # make some choices about what filters to add, or machines to build
         # based on the info the Apache::Request object in $r
       
         # assumes 'use XML::SAX::Machines qw( Pipeline );'
         my $machine = Pipeline( @list_of_filters_we_picked ); 
         return $machine;
    }
  
  Note that machines can be nested sets of other machines just as in the regular 
  usage of XML::SAX::Machines, get_machine() need only return the top-level 'wrapper machine'. 
  
  =head2 When Worlds Collide ( Using Both AxSAXMAchineFilters and AxSAXMachineClass )
  
  In cases where both AxSAXMachineFilters and AxSAXMAchineClass are used to set up the 
  processing for a given request, the machine returned by  AxSAXMAchineClass is given 
  processing precedence. That is, the document's event stream will be run through the
  machine returned by the AxSAXMAchineClass first, and then passed through the filters
  defined by the AxSAXMAchineFilters directive. So,
  
      PerlSetVar AxSAXMachineFilters "XML::Filter1 XML::Filter2"
      PerlSetVar AxSAXMachineClass "Custom::MachineBuilderClass"
  
  appearing in the same config block would send the document's events through a linear pipeline
  consisting of the machine returned by Custom::MachineBuilderClass's get_machine() method 
  followed by the filters XML::Filter1 and XML::Filter2.
  
  =head1 SEE ALSO
  
  AxKit, XML::SAX::Machines
   
  =cut
  
  
  
  1.5       +3 -2      xml-axkit/lib/Apache/AxKit/Provider/File.pm
  
  Index: File.pm
  ===================================================================
  RCS file: /home/cvs/xml-axkit/lib/Apache/AxKit/Provider/File.pm,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- File.pm	21 Apr 2002 14:07:16 -0000	1.4
  +++ File.pm	13 May 2002 19:33:28 -0000	1.5
  @@ -1,4 +1,4 @@
  -# $Id: File.pm,v 1.4 2002/04/21 14:07:16 matts Exp $
  +# $Id: File.pm,v 1.5 2002/05/13 19:33:28 kip Exp $
   
   package Apache::AxKit::Provider::File;
   use strict;
  @@ -178,7 +178,8 @@
   sub get_strref {
       my $self = shift;
       if ($self->_is_dir()) {
  -        throw Apache::AxKit::Exception::IO(-text => "$self->{file} is a directory - please overload File provider and use AxProvider option");
  +        throw Apache::AxKit::Exception::IO(
  +          -text => "$self->{file} is a directory - please overload File provider and use AxContentProvider option");
       }
       my $fh = $self->get_fh();
       local $/;