Re: [xsl] Managing XSLTS for XSLFO - Shared templates and attribute sets

Subject: Re: [xsl] Managing XSLTS for XSLFO - Shared templates and attribute sets
From: Kamal <kbhatt@xxxxxxxxx>
Date: Thu, 27 Mar 2008 22:58:22 +1100
G. Ken Holman wrote:
At 2008-03-27 22:31 +1100, Kamal wrote:
I have a number of XSLTs for our clients that produce XSL FO. Right now, I make extensive use of attribute sets. I basically setup all my attribute sets at the start of the file and call them as I need them. This works great, just as long as you don't want to share templates. Unfortunately, I am going to need to share some of those templates in the future, but the attributes used may be different (obviously, these attributes are defining styling).

Any thoughts as to how I can have my cake and eat it too?

Have a stylesheet fragment defining common sets and common behaviours, then have different stylesheet fragments for each distinct environment import the common fragment. Each environment will then have their own distinct amalgam of their specific styles and the common styles.


To see an example of this, there is a free stylesheet library in the developer resources section of our web site (linked below) for presenting instances of the Universal Business Language (UBL) to both HTML and PDF. This library illustrates the importation of common fragments, including a common fragment between both HTML and XSL-FO stylesheets implementing the access to the UBL instances. This common bit is at the bottom of each import hierarchy. A number of the stylesheet fragments in this library are synthesized using another resource we make available that is a stylesheet that writes stylesheets ... so designed precisely to allow different environments to import common behaviours.
I am having trouble finding the exact XSLTs you are talking about. I got this far:

http://www.cranesoftwrights.com/resources/ubl/index.htm

But I don't know which file I should look at.

Thanks.

Current Thread