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

RE: Applying two transformations consecutively

Subject: RE: Applying two transformations consecutively
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Mon, 25 Jun 2001 17:13:01 +0100
product of two transformations
> I do have two .xsl transformations in two files which should
> be applied
> consecutively. The first xsl file includes something like
>   <xsl:template match="ELEMENT">
> 	...
>   </xsl:template>
> The other xsl file includes a rule which operates on the same
> ELEMENT. I
> could call xslt two times for each of the two files. But I
> would like to
> merge these files for speed resons to call xslt only once.
> If I use xsl:include only the rule defined last will be
> applied. What I
> would like to have is that the rule of the first file is
> executed first and
> the result is fed to the second rule.

You can do a two-phase transformation in a single stylesheet by using the
node-set() extension function. The typical pattern is:

<xsl:variable name="phase1out">
  <xsl:apply-templates select="/" mode="phase1"/>
</xsl:variable>

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

Mike Kay
Software AG


 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.