W3C home > Mailing lists > Public > www-xsl-fo@w3.org > March 2004

Re: Multiple XMLs to One PDF.

From: David Carlisle <davidc@nag.co.uk>
Date: Fri, 12 Mar 2004 15:13:21 GMT
Message-Id: <200403121513.PAA28797@penguin.nag.co.uk>
To: viral.patel@countryfinancial.com
Cc: www-xsl-fo@w3.org

> 2. I have 3 different XSLs that I want to use for each XML: 
ah that makes it more interesting.

You can't really do that in xslt 1, but you can achieve the effect so
long as the three stylesheets are written to use  modes on all templates
and uses of apply-templates, a different mode in each stylesheet.


you can have a top level stylesheet that imports all three stylesheets,
and if it wants to transform a document with the stylesheet using mode
one (say) you'd do

<xsl:apply-templates match="document(@href)" mode="one"/>

when this is executed, even though all your stylesheets have been
imported, only the templates from the stylesheet using mode one will

there are of course alternative strategies.

While joining pdf files together requires specialist software (or a very
very careful reading of the pdf spec) it isn't so hard to merge FO files

You may prefer to do all your transformations separately, using
different stylesheets then use a final "merging" xslt stylesheet that
use the document() function to pull in all the individual stylesheets,
and pull them all under one fo:root. That way you don't need to worry
about combining the transform and the merge. For each FO document you
just need to navigate down to teh part you want and then copy the whole
subtree using xsl:copy-of into your combined FO file.


This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
Received on Friday, 12 March 2004 10:14:03 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:10:00 UTC