Subject: Applying a named template to arbitrary content From: Iain Huxley <iain@xxxxxxxxxxxxx> Date: Sun, 12 Mar 2000 21:22:06 -0800 |
e.g. ... <font size="4" color="#ffffff"> <b> ...content... </b> </font> ..
<xsl:template name="FontAppearance"> <font size="4" color="#ffffff"> <b> <xsl:apply-templates/> </b> </font> </xsl:template>
usage: <xsl:call-template name="FontAppearance"/>
<xsl:template name="FontAppearance"> <xsl:param name="content"> <font size="4" color="#ffffff"> <b> <xsl:copy-of select="$content"/> </b> </font> </xsl:template>
usage: <xsl:variable name="foo"> <!-- content example - call index template --> <xsl:call-template name="Index"/> </xsl:variable> <xsl:call-template name="FontAppearance"> <xsl:param name="content"> <xsl:value-of select="$foo"> </xsl:param> </xsl:call-template>
<xsl:call-template name="FontAppearance_Body1"> <!-- following would be inserted into the FontAppearance template --> <xsl:call-template name="Index"/> </xsl:call-template>
<xsl:call-template name="FontAppearance_Heading1"> <xsl:value-of select="Title"/> </xsl:call-template>
<xsl:call-template name="FontAppearance_Body2"> <xsl:apply-templates select="Sections"/> </xsl:call-template>
//---------------------------------------------------- // Iain Huxley // President // Mindspike Technologies // http://mindspike.com // Ph: (510) 339 7789 //----------------------------------------------------
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
XSLT Market Need, Michael Laing | Thread | Re: Applying a named template to ar, Steve Tinney |
Re: sort, count, number, group, Steve Tinney | Date | RE: Unanswered queries, Kay Michael |
Month |