Hi David, that is great, thanks for the examples too! I will try those
out, I think that route would suit what I am trying to do well.

Kip, a book on AxKit, Superb and congrats! I'll be adding that to my
amazon wishlist for sure.

Cheers guys, 
Tom

-----Original Message-----
From: David Nolan [mailto:[EMAIL PROTECTED] 
Sent: 21 June 2004 13:34
To: Tom Howe; 'Kip Hampton'; 'David Nolan'
Cc: [EMAIL PROTECTED]
Subject: RE: Trying to get my head around Stylesheet Choosing & pipeline
type stuff




--On Monday, June 21, 2004 12:54 PM +0100 Tom Howe <[EMAIL PROTECTED]>

wrote:

> I've tried a number of things but I'm still having difficulty defining
a
> pipeline outside of the PIs.
> I looked at the example Stylechoosers and created one myself but since
> they populate the $r->pnotes('preferred_style') I can only seem to be
> able to define a single style. I tried putting an arrayref of style
> names in there but it barfed. If I want to setup a chain of processors
> without using the PIs is there a way of doing it?
>

I've never actually used a stylechooser myself, since I use a provider
to 
provide my content.  It just returns a list of styles when asked for
one.

But my reading of the documentation is that a given request can have one

Style associated with it, then you do stuff based upon that in your 
httpd.conf.  So for example, say you have a 3 phase pipeline:

phase 1: only one choice, foo.xslt
phase 2: two options, bar.xslt and baz.xslt
phase 3: 4 options, 2 for each in the previous phase:
         bar-xyz.xslt bar-abc.xslt baz-xyz.xslt baz-abc.xslt

so you have four possible paths in the pipeline.  So you'll need 4 Style

names, and four sections in your httpd.conf

AxAddProcessor text/xsl /stylesheets/foo.xslt
<AxStyleName bar-xyz>
  AxAddProcessor text/xsl /stylesheets/bar.xslt
  AxAddProcessor text/xsl /stylesheets/bar-xyz.xslt
</AxStyleName>
<AxStyleName bar-abc>
... etc...

Personally I prefer the provider approach.  I think you get more 
flexibility, and less redundant configuration.  For the above case, you 
would want something like:

sub get_styles {
  my $self = shift;
  my @styles;

  push @styles, {type => "text/xsl", href => "/stylesheets/foo.xslt"};

  if (<some test for bar vs baz here>) {
    push @styles, {type => "text/xsl", href => "/stylesheets/bar.xslt"};
    if (<some test for abc vs xyz here>) {
      push @styles, {type => "text/xsl", href => 
"/stylesheets/bar-abc.xslt"};
    } else {
      push @styles, {type => "text/xsl", href => 
"/stylesheets/bar-xyz.xslt"};
    }
  } else {
    push @styles, {type => "text/xsl", href => "/stylesheets/baz.xslt"};
    if (<some test for abc vs xyz here>) {
      push @styles, {type => "text/xsl", href => 
"/stylesheets/baz-abc.xslt"};
    } else {
      push @styles, {type => "text/xsl", href => 
"/stylesheets/baz-xyz.xslt"};
    }
  }

  return [EMAIL PROTECTED];

}

-David

David Nolan                    <*>                    [EMAIL PROTECTED]
curses: May you be forced to grep the termcap of an unclean yacc while
      a herd of rogue emacs fsck your troff and vgrind your pathalias!


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to