RE: Applying two transformations consecutively
> 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
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