[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] greenhorn problem with variables
Hi, I've got a quite simple problem. I've tested a lot, but didn't get the solution.So I hope you give me a hint. In a template I calculate a bgcolor depending on position: <xsl:template match="eintrag"> <xsl:variable name="color"> <xsl:choose> <xsl:when test="(position() mod 2) > 0">#C0C0C0</xsl:when> <xsl:otherwise>#FFFFFF</xsl:otherwise> </xsl:choose> </xsl:variable> <tr> <xsl:apply-templates select="nr"/> <xsl:apply-templates select="km"/> <!-- ... --> </tr> </xsl:template> I need to use the variable in the applied templates. Here is an example: <xsl:template match="nr"> <td bgcolor="{$color}"> <xsl:value-of select="."/> </td> </xsl:template> How can I solve this? I can't calculate the color global... Can I solve this with params instead of varialbes? I tried but didn't get it. Best regards Volker
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|