Subject: Standardizing HTML look-and-feel in XSL (named templates)
From: "Bernie H." <bernie@xxxxxxxxxxxxxx>
Date: Tue, 7 Dec 1999 21:08:44 -0500
|
I'm having trouble figuring out the best way to define a standardized HTML look-and-feel across my entire XSL page. For example, I want to define a named template ("TABLE_CELL") that wraps a <TD></TD> set around whatever calls it. I want to use this for all my XML elements so that I can change the BGCOLOR attribute in it and have the change apply throughout.
<xsl:template name="TABLE_CELL">
<TD BGCOLOR="#000000">
<xsl:value-of select="."/>
</TD>
</xsl:template>
However, the <xsl:call-template> call seems to be very restrictive. For example, if I want to also periodically use this hypothetical "BOLD" named template to wrap <B></B> tags...
<xsl:template name="BOLD">
<B>
<xsl:value-of select="."/>
</B>
</xsl:template>
... I can't. My lame attempt so far looks like this:
<xsl:template match="NAME">
<xsl:call-template name="TABLE_CELL">
<xsl:call-template name="BOLD"/>
</xsl:call-template>
</xsl:template>
... but it only executes the "TABLE_CELL" named template.
Has anyone else tried to do this type of thing before? Am I thinking about this problem the wrong way?
For the sake of this argument, I'm sticking with pure XSL Transformations (i.e. no "fo:" formatting namespace>.
Thanks,
Bernie
bernie@xxxxxxxxxxxxxx
_________________________________
Breakbeat Era/ES Sports Contest Givaway
http://www.platform.net/ads/100699breakbeatera/
Win a platstation:
SignUP at http://www.platform.net
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|