On Tuesday 23 December 2003 8:45 pm, Arne Claassen wrote:
> Can i affect what XSL styelsheets are included with a styleprocessor? I
> tried just pushing more than one stylesheet onto @styles in a dynamic
> processor, but that seems to give the XML a choice where to start, but
> can't use templates from them all at the same time.
>
> For example, let's say i have utility stylesheets user_util.xsl and
> group_util.xsl. Let's assume both are pretty sizable, so i wouldn't
> want to include them unless i needed them.
>
> So if i have three documents
>   user.xml
>   group.xml
>   usergroup.xml
> They all share the same layout.xsl for look and feel but need one or
> more of the above stylesheets.

There are a number of possible approaches. You can invoke different 
stylesheets based on:

1. Type of file (extension) so you could provide a different extension for 
files requiring different handling. In some cases this is logical, ie you 
have several different XML syntaxes that you use and each is processed 
differently. Doesn't sound like this particular instance falls into that 
category, but its always good to consider.

2. You can select processors depending on the root tag in your document. 
Pretty similar to option 1 generally.

3. You could put files that use a particular pipeline layout or particular 
master XSLT stylesheet into separate directories. 

4. You could load your stylesheet via a provider which could figure out which 
pages need to include what, but then what have you gained? You will just have 
to configure THAT (or hardcode your choices which is even worse).

5. You can aggressively factor your XSLT so that only a small amount is 
different between pages. You might be able to factor your pipeline so that 
those parts can be placed in a separate pipeline stage, and have that stage 
be the only part that varies. 

Personally experience has shown me that 90% of pages will use the same 
template, so I configure my sites for the 90% case in .htaccess/httpd.conf 
and then either segregate the oddball parts into separate subdirectories or 
in a few cases use PIs in those pages.

Personally I'm not much of a fan of 'put logic in a provider' as a design 
pattern. Providers provide data, but they really were never intended to serve 
a control function. 

>
> Right now i see myself creating
> user.xsl which includes layout.xsl and user_util.xsl
> group.xsl which includes layout.xsl and group_util.xsl
> and
> usergroup.xsl which includes layout.xsl, user.xsl and group_util.xsl
>
> I'd much rather have a provider that can recognize what stylesheets
> will be needed and include them at request time. Is this possible?
>
> As an alternative are stylesheets just slurped in via a http request,
> so i could just write a mod_perl handler that generates the appropriate
> XSL stub?
>
> thanks
> arne
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

-- 
Tod Harter
Giant Electronic Brain
http://www.giantelectronicbrain.com


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

Reply via email to