[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: multi-phase transformations (was untitled)
> 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|