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

Q: is there a "template" template?

Subject: Q: is there a "template" template?
From: Aaron Fischer <fischer17@xxxxxxxx>
Date: Mon, 12 Jul 1999 10:12:09 -0700
the template of 10 q

I am trying to greatly simplify my XSL code. 

I have a basic template transformation:

<xsl:template match="control">
<
xsl:text &#10; &#10;CONTROL&#10; &#10;</xsl:text>
<xsl:apply-templates/>
<xsl:text &#10;END&#10; &#10;</xsl:text>
</xsl:template>

I need to apply this kind of template to literally hundreds of different cells;  i.e. I have other cells which require the same kind of template, except replace "control" with "[something else]".

At the moment I have a huge XSL file full of these little templates -- with all of them doing the same thing under a different name.

Is there a way I can write a "template" template, and have my code internally generate
the actual templates during compilation?  i.e I would have something like:

the "template" template:  PARAM1 - match specification
    PARAM2 - output text

<xsl:template match="PARAM1">
<
xsl:text &#10; &#10;PARAM2&#10; &#10;</xsl:text>
<xsl:apply-templates/>
<xsl:text &#10;END&#10; &#10;</xsl:text>
</xsl:template>

make-template( "control", "CONTROL")
make-template( "output", "OUTPUT")
make-template( "blah", "whatever")

etc...

Basically, I'm looking for a template in the true sense of the word, as in the C++ way.

All help appreciated,

Aaron

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.