<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2655.72">
<TITLE>XSL question</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2 FACE="Arial">OK, I don't think this is really possible but I wanted to toss it out just in case I'm wrong.</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Does anybody know if you can, in a single stylesheet, take the results of a template (named) and pipe that template's output into another template?</FONT></P>
<P><FONT SIZE=2 FACE="Arial">I want to run an XSLT file against other XSLT files and extract information from them. I also want to separate the processing from the display, so in effect I want a pre-processor that extracts the information, and then another processor which applies the format.</FONT></P>
<P><FONT SIZE=2 FACE="Arial">Something like this is what I'm looking for:</FONT>
</P>
<P> <FONT SIZE=2 FACE="Arial"><xsl:template name="preprocess"></FONT>
<BR> <FONT SIZE=2 FACE="Arial"><xsl:for-each select="/"></FONT>
<BR> <FONT SIZE=2 FACE="Arial"><doc></FONT>
<BR> <FONT SIZE=2 FACE="Arial"><foo><xsl:value-of select="/xsl:stylesheet/foo"/></foo></FONT>
<BR> <FONT SIZE=2 FACE="Arial"><bar><xsl:value-of select="/xsl:stylesheet/bar"/></bar></FONT>
<BR> <FONT SIZE=2 FACE="Arial"></xsl:for-each></FONT>
<BR> <FONT SIZE=2 FACE="Arial"></xsl:template></FONT>
</P>
<P> <FONT SIZE=2 FACE="Arial"><xsl:template name="display"></FONT>
<BR> <FONT SIZE=2 FACE="Arial"><p><var>Foo</var> = <xsl:value-of select="/doc/foo"/></p></FONT>
<BR> <FONT SIZE=2 FACE="Arial"><p><var>Bar</bar> = <xsl:value-of select="/doc/bar"/></p></FONT>
<BR> <FONT SIZE=2 FACE="Arial"></xsl:template></FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">What I'm missing is the way to tie the "preprocess" template's results into the "display" template's input. I don't think you can do that, because I believe the XSL functions such that each template writes to a single output stream. Would be nice if you could control that somehow though...</FONT></P>
<P><FONT SIZE=2 FACE="Arial">Basically this is reflection on a stylesheet. If I have to break the two up into separate stylesheets and <xsl:import> the pre-processor in, that's fine, but I really (really really really) want to keep the actual transformation contained so I can look at an XSL file in Internet Explorer and it will do the transform for me automatically. If I have to write any code to do this, it really defeats the purpose of this whole approach.</FONT></P>
<P><FONT SIZE=2 FACE="Arial">Maybe there's a better way to do this?</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Thanks!</FONT>
<BR><FONT SIZE=2 FACE="Arial">-dave</FONT>
</P>
</BODY>
</HTML>