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

Re: apply two different templates at the same time

Subject: Re: apply two different templates at the same time
From: "Agnes kielen" <a.kielen@xxxxxxx>
Date: Thu, 31 Jan 2002 19:03:30 +0100
two different styles in td
Hello Andrew,
I had such a problem once, but I had to repeat the color over and over.
Maybe you can use it (I just want to show it).

<xsl:template match="ROW">
      <!-- Create variable for background -->
       <xsl:variable name="style">
            <xsl:choose>
                 <xsl:when test="BLOK='X'">background:yellow </xsl:when>
                 <xsl:otherwise>background:white </xsl:otherwise>
            </xsl:choose>
       </xsl:variable>

       <tr>
            <td style="{$style}>do something</td>
            <td style="{$style}>do something</td>
                etc
        </tr>
</xsl:template>

Greetz,
Agnes Kielen

----- Original Message -----
From: "Andrew Welch" <andrew@xxxxxxxxxxxxxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Thursday, January 31, 2002 11:53 AM
Subject: 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@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
>


 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.