Subject: RE: apply two different templates at the same time
From: "Andrew Welch" <andrew@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 31 Jan 2002 10:53:20 -0000
|
I think I overestimated the original problem... I just used:
<xsl:template match="para">
<p>
<xsl:if test="@mark">
<xsl:attribute
name="style">background-color:#C0C0C0</xsl:attribute>
</xsl:if>
..........
</p>
</xsl:template>
cheers
andrew
===
-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Michael Kay
Sent: Thursday, January 31, 2002 10:32 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE: apply two different templates at the same time
> Currently, I use two templates for each element - one
> matching just the
> element and one matching the element with the 'mark' attribute...
>
> ...is it possibly to cut down on the duplication of code?
>
Call one of the templates from the other using <xsl:call-template/> (or
break out the common code into a named template that both call).
Mike Kay
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
- RE: Javascript inside XSL(Just when I think I understand), (continued)
- Michael Kay - Thu, 31 Jan 2002 04:39:19 -0500 (EST)
- Andrew Welch - Thu, 31 Jan 2002 04:45:56 -0500 (EST)
- Andrew Welch - Thu, 31 Jan 2002 05:13:51 -0500 (EST)
- Michael Kay - Thu, 31 Jan 2002 05:30:28 -0500 (EST)
- Andrew Welch - Thu, 31 Jan 2002 05:59:22 -0500 (EST) <=
- Agnes kielen - Thu, 31 Jan 2002 13:01:00 -0500 (EST)
- Andrew Welch - Thu, 31 Jan 2002 05:45:28 -0500 (EST)
- Joerg Heinicke - Thu, 31 Jan 2002 05:57:30 -0500 (EST)
- Andrew Welch - Thu, 31 Jan 2002 06:43:15 -0500 (EST)
|
|