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

RE: multi-phase transformations (was untitled)

Subject: RE: multi-phase transformations (was untitled)
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Wed, 14 Mar 2001 10:10:25 -0000
multi phase stylesheets
> I guess my general question is, how do you have one xsl
> output an xml file
> and then have a 2nd xsl automatically process it?
>
There are two approaches: the one-stylesheet approach and the
multi-stylesheet approach.

In the one-stylesheet approach, you need the node-set() extension to make
the output of the first phase accessible to the second. You also need to
ensure that the rules for each phase are kept separate. One way to do this
is with modes, another way is by using a different namespace for the source
tree and the intermediate tree. Putting the rules in different stylesheet
modules is helpful but doesn't itself solve the problem. The typical logic
(for three phases) is:

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

<xsl:variable name="phase2-output">
  <xsl:apply-templates select="node-set($phase1-output)" mode="phase2"/>
</xsl:variable>

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

The alternative multi-stylesheet approach is to control several
transformations linked together into a pipeline from the transformation API.
The TrAX API allows a transformation to be configured as a SAX Filter which
makes this very convenient.

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.