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

Re: Findings: Merging XSL:FO & HTML Style Sheets

Subject: Re: Findings: Merging XSL:FO & HTML Style Sheets
From: Joerg Pietschmann <joerg.pietschmann@xxxxxx>
Date: Wed, 06 Mar 2002 09:29:48 +0100
merging xsl stylesheets
Peter Davis <pdavis152@xxxxxxxxx> wrote:
> I've had to solve something very similar to your problem in the past, but I
> came up with a slightly different solution.  It's kind of a hack to get
> around that <apply-templates mode="{}"> and <call-template name="{}"> cannot
> be specified dynamically,
...
You might also want to look into Dimitre Novatchev's functional programming
style. Simplified, it looks like this
 <xsl:stylesheet version="1.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:f="uri:my.name.space">

   <f:myfunc/>

   <xsl:template match="f:myfunc">
     <xsl:param name="theNode"/>
     ... do stuff ...
   </xsl:template>

   <!-- use it somewhere -->
   ...
     <xsl:apply-templates select="document('')/*/f:myfunc">
       <xsl:with-param name="theNode" select="."/>
     </xsl:apply-templates>
   ...
 </xsl:stylesheet>

In this approach, what you think of as "mode" is the select referring
to the f:myfunc element, and what goes into the select in a moded
template invocation now goes into the "theNode" parameter. You can
store the f:myfunc node in a variable and pass it around in parameters.
Dimitres website has deeper and more precise explanations and examples,
as has the list archive. It's not quite as elegant as having the mode
attribute to be an AVT, but it has the same expressive power.

Regards
J.Pietschmann

 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.