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

RE: doubt regarding position() mod 2

Subject: RE: doubt regarding position() mod 2
From: "Anand Ganapathy" <Anand.Ganapathy@xxxxxx>
Date: Tue, 23 Apr 2002 14:03:43 +0530
anand ganapathy
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


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-2011 All Rights Reserved.