[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Conversion from xsl to xsl:fo

Subject: Re: Conversion from xsl to xsl:fo
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 24 Oct 2001 12:07:23 +0100
xsl to xsl fo
Max,
> I thought of writing a stylesheet that will convert an XSLT stylesheet
> that produces an XHTML document to an XSLT stylesheet that produces FO
> (i.e. an XSL stylesheet) but I found it hard or not really possible to
> do. I don't remember why.

There are (at least) two ways to get from 
"(1): a stylesheet producing X" and "(2): a styleheet converting X to Y"
to "(3): a stylesheet producing Y"

plan a)
write a stylesheet that takes (1) as input and modifies all the
templates so that where they use constructions from the language X
the result is a template using constructions from language Y.
There is an example of a stylesheet which convers HTML generators to
XHTML generators in the MathML distribution (and the archives of this
list). This can get tricky if you want to spot xsl:element constructions
using Xpath expressions that might dynamically evaluate to constructs in
language X. (Spotting literal result elements is a lot easier)

plan b)
is to use a xx:node-set extension and just write stylesheet (3) like so:

<xsl:import href="stylesheet1"/>
<xsl:import href="stylesheet2"/>

<xsl:variable name="tmp">
 <xsl:apply-templates/>
</xsl:variable>

<xsl:template match="/">
 <xsl:apply-templates mode="convert" select="xx:node-set($tmp)"/>
</xsl:template>


(assuming all the templates in stylesheet 2 use the "convert" mode)

David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.