How to use Stylesheets from different resource folders?

Here should go questions about transforming XML with XSLT and FOP.
chrishaase
Posts: 8
Joined: Thu Mar 31, 2005 2:13 pm
Location: Hannover, Germany

How to use Stylesheets from different resource folders?

Post by chrishaase » Mon Aug 27, 2007 5:31 pm

Hi all!

I need to use Stylesheets from multiple different folders for a single transformation process. Is there a way to configure FOP or Oxygen to read the .xsl files from multiple folders?

For example, I have this:

/general/adress.xsl
/general/pagemaster.xsl
/general/firstpage.xsl
/general/restpage.xsl

and

/letter/letter1.xsl
/letter/letter2.xsl

/offer/offer1.xsl
/offer/offer2.xsl

/billing/billing.xsl

Processing letter1.xsl needs to include all stylesheets from the the general folder (adress.xsl, pagemaster.xsl, ...), the same is for letter2, offer1, billing.xsl and so on.
At the moment this works only if 'general' is a subfolder of letter, offer and billing.

Any suggestions?

Greetings, Chris

chrishaase
Posts: 8
Joined: Thu Mar 31, 2005 2:13 pm
Location: Hannover, Germany

Post by chrishaase » Tue Aug 28, 2007 11:44 am

P.S: All Stylesheets in folder 'general' are used as substyles with xsl:include in letter, offer and billing.

sorin_ristache
Posts: 4144
Joined: Fri Mar 28, 2003 2:12 pm

Re: How to use Stylesheets from different resource folders?

Post by sorin_ristache » Tue Aug 28, 2007 12:09 pm

Hello,
chrishaase wrote:Processing letter1.xsl needs to include all stylesheets from the the general folder (adress.xsl, pagemaster.xsl, ...), the same is for letter2, offer1, billing.xsl and so on. At the moment this works only if 'general' is a subfolder of letter, offer and billing.
You have to specify the path to general/adress.xsl, general/pagemaster.xsl, etc in the include elements of letter1.xsl, letter2, offer1.xsl and the other stylesheets which need to include the stylesheets located in the "general" folder. For example if letter1.xsl is located in /a/b/c/letter1.xsl and address.xsl is located in /a/e/f/adress.xsl then letter1.xsl must specify:

Code: Select all


<xsl:include href="../../e/f/address.xsl"/>
<xsl:include href="../../e/f/pagemaster.xsl"/>
...

Regards,
Sorin

chrishaase
Posts: 8
Joined: Thu Mar 31, 2005 2:13 pm
Location: Hannover, Germany

Post by chrishaase » Tue Aug 28, 2007 2:01 pm

Works fine! Thank you very much! :-)

Greetings,
Chris

Post Reply