Hello *

I would like to select an output transformer the same way I select a 
stylesheet from a query string. I mean: if I have a document I want to 
be transformed differently, depending on the style=something parameter 
in the query string, I can do something like:

PerlHandler 
Apache::AxKit::StyleChooser::QueryString AxKit

     <Files *.xcv>
       <AxMediaType screen>
         <AxStyleName "#default">
           AxAddProcessor application/x-xpathscript /style/xcv.xps
         </AxStyleName>

         <AxStyleName abstract>
           AxAddProcessor application/x-xpathscript /style/abs.xps
         </AxStyleName>

...and so on. So I expected that doing something like:

         <AxStyleName latex>
          AxResetOutputTransformers
          AxAddOutputTransformer UTF2LaTeX::Transformer
           AxAddProcessor application/x-xpathscript /style/xcv-tex.xps
         </AxStyleName>

would select the transformer only when style=latex is set. 
Unfortunately, this doesn't happen. AxAddOutputTransformer is, like, 
global and passes through the borders set by <Files> directive and all 
files with all styles get processed by the Transformer, which results in 
a disaster.

I put a workaround on it, putting this couple of lines on top of the 
Transformer subroutine:

     my %args = Apache->request->args() ;
     return $_ if $args{style} ne 'latex' ;

but that's not the kind of solution I like to use... sound artificial 
and adds the overhead of creating an Apache->request object at every 
call of Transformer.

Any other solution would be welcome!

Thanks in advance
--bronto

-- 
Marco Marongiu                         Email: [EMAIL PROTECTED]
CRS4 Research Center                   Phone: +39 070 2796 336
NCS Division                           Fax:   +39 070 2796 216
NSM Group                              WWW: http://bugs.unica.it:4444/




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

Reply via email to