[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Accessing specific repetitive node
At 2004-03-05 11:47 +0000, Mark Williams wrote:
The XML looks like this Is it that you need to return all odd-numbered items? Or do you need just the first, third and fifth items of all sets? I have tried it in the following ways: Those two are equivalent: the first is the abbreviation of the second. <xsl:value-of> returns only a single item so you cannot use it to return multiple items. To access every odd item in the list you could use modulus arithmetic: <xsl:for-each select="DATA/Table[@ID='2']/Data/Code[position() mod 2 = 1]"> <xsl:if test="position() > 1">, </xsl:if> <xsl:value-of select="."/> </xsl:for-each> I hope this helps. ............................... Ken -- US XSL training: Washington,DC March 15; San Francisco,CA March 22 World-wide on-site corporate, government & user group XML training G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) Male Breast Cancer Awareness http://www.CraneSoftwrights.com/s/bc XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|