RE: [xsl] doubt regarding position() mod 2

Subject: RE: [xsl] doubt regarding position() mod 2
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Tue, 23 Apr 2002 12:27:02 +0100
I don't usually try to debug people's stylesheets unless I can see them.
This time I tried and it seems I guessed wrong. Your next step is to show us
your code.

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Anand
> Ganapathy
> Sent: 23 April 2002 09:34
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: RE: [xsl] doubt regarding position() mod 2
>
>
> Hello Michael,
> Thanks. I used <xsl:strip-space elements="*"/> as suggested
> by you but it doesn't work.Am I missing out on something
> else.Would you suggest any other approach to do the same?
> Anand
>
> >>> "Michael Kay" <michael.h.kay@xxxxxxxxxxxx> 04/23/02 01:27PM >>>
> > In my XSL, I tried using a test condition  <xsl:if
> > test="position() mod 2 = 1">,
> > This test condition should return true for any item element
> > that is an odd-numbered item child of its parent and hence
> > 'Meat' and 'Chocolate' should be diplayed in the same color
> > whereas 'Dairy' should be in a different color.
> > However, I am getting all these in the same color.
>
> You probably forgot to strip out the whitespace text nodes,
> which means that
> the children of an element will have whitespace text nodes at
> odd numbered
> positions and element nodes at even numbered positions.
>
> Use <xsl:strip-space elements="*"/>
>
> Michael Kay
> Software AG
> home: Michael.H.Kay@xxxxxxxxxxxx
> work: Michael.Kay@xxxxxxxxxxxxxx
>
>
>  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