This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: apply two different templates at the same time



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@lists.mulberrytech.com
[mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of Michael Kay
Sent: Thursday, January 31, 2002 10:32 AM
To: xsl-list@lists.mulberrytech.com
Subject: RE: [xsl] 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]