RE: [xsl] Incremental Numbering

Subject: RE: [xsl] Incremental Numbering
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Wed, 10 May 2006 10:22:21 +0200
At 2006-05-10 09:12 +0100, Mark Williams wrote:
There could be a large number of options potentially so I'm keen to
avoid a solution that has to input every possible option.

Absolutely ... that was why I asked for clarification and stated my assumptions for your data. You happened to enumerate each element name in your example.

I think what I need to do is structure the XML returned from html page
so that it groups all options with a value of 1 together.

<options> <option>1</option> <option>0</option> <option>1</option> <option>0</option> </options>

I can then just use count and position.

Indeed ... and you can change your focus to each option and build your table rows quite easily:

<xsl:for-each test="option[.=1]">
         <xsl:value-of select="count(preceding-sibling::option[.=1])+1"/>

Sorry to all if I didn't make what I was trying to do clear.

No apology necessary ... we can only help based on the information we are given.

. . . . . . . . . Ken

Registration open for XSLT/XSL-FO training: Wash.,DC 2006-06-12/16
Also for XSLT/XSL-FO training:    Minneapolis, MN 2006-07-31/08-04
Also for XML/XSLT/XSL-FO training:Birmingham,England 2006-05-22/25
Also for XSLT/XSL-FO training:    Copenhagen,Denmark 2006-05-08/11
World-wide on-site corporate, govt. & user group XML/XSL training.
G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Cancer Awareness Aug'05
Legal business disclaimers:

Current Thread