Subject: Re: [xsl] how to increment a variable in a for-each loop From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Wed, 23 Jan 2002 18:43:09 -0500 |
Good luck, Wendell
I have a code snippet as below: <xsl:template match="*" mode="diff_cols"> <xsl:for-each select="."> <xsl:if test="position() mod 2 = 1"> <fo:table-cell background-color="red"> <fo:block><xsl:value-of select="."/></fo:block> </fo:table-cell> </xsl:if> <xsl:if test="position() mod 2 = 0"> <fo:table-cell background-color="blue"> <fo:block><xsl:value-of select="."/></fo:block> </fo:table-cell> </xsl:if> </xsl:for-each> </xsl:template>
Unfortunately, it did not work. The background color in all columns is red.
Can you help to debug?
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] how to increment a variab, Joerg Heinicke | Thread | Re: [xsl] how to increment a variab, Matthew Jaquish |
Re: [xsl] Addition/Subtraction of n, Joerg Heinicke | Date | Re: [xsl] which XML parser is the f, Joerg Heinicke |
Month |