xsl-list
[Top] [All Lists]

RE: [xsl] Incremental Numbering

2006-05-10 04:16:10
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]">
   <fo:table-row>
     <fo:table-cell>
       <fo:block>
         <xsl:value-of select="count(preceding-sibling::option[.=1])+1"/>
       </fo:block>
     </fo:table-cell>
     <fo:table-cell>
       <fo:block>1</fo:block>
     </fo:table-cell
   </fo:table-row>
</xsl:for-each>

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(_at_)CraneSoftwrights(_dot_)com
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Cancer Awareness Aug'05  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>