[thelist] XSL question

David.Cantrell at Gunter.AF.mil David.Cantrell at Gunter.AF.mil
Tue Mar 11 15:43:58 CST 2003


OK, I don't think this is really possible but I wanted to toss it out just
in case I'm wrong.

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?

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.

Something like this is what I'm looking for:

	<xsl:template name="preprocess">
		<xsl:for-each select="/">
			<doc>
				<foo><xsl:value-of
select="/xsl:stylesheet/foo"/></foo>
				<bar><xsl:value-of
select="/xsl:stylesheet/bar"/></bar>
		</xsl:for-each>
	</xsl:template>

	<xsl:template name="display">
		<p><var>Foo</var> = <xsl:value-of select="/doc/foo"/></p>
		<p><var>Bar</bar> = <xsl:value-of select="/doc/bar"/></p>
	</xsl:template>

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...

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.

Maybe there's a better way to do this?

Thanks!
-dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/thelist/attachments/20030311/3ad48d62/attachment.htm>


More information about the thelist mailing list