Re: [xsl] Display count function output as letter value instead of number value

Subject: Re: [xsl] Display count function output as letter value instead of number value
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Tue, 19 Aug 2008 11:40:44 -0400
Sharon,

You haven't shown us a sample of your input document or specified what "correct" numbering would be. (Maybe that was in an earlier post, in which case please forgive me for not having retained that information.) Without these, we are guessing.

Nevertheless, it seems you may not have tried <xsl:number level="any"/>, which (inferring from scattered bits of information) appears to be what you want.

As background:
level="single" counts an element among its siblings; it's appropriate when counting list items and such.
level="multiple" emits a multi-level number, and would be used when generating things like multi-level section numbering ("Section I.A.3-c" and similar).
level="any" counts any element matching the specified count below the level of the ancestor indicated by the 'from' setting, and is appropriate for numbering tables, figures, boxes within documents, sections, chapters, or whatever.


Andrew started by suggesting you look up xsl:number and take it from there. Your sources will have documented all this. Using xsl:number correctly often involves getting several settings right. When teaching, I recommend setting 'level' first (what kind of numbering you want), then (if necessary) 'from' (the scope within which you are numbering), then (if necessary) 'count' (restricting or expanding what you are numbering).

Also, in general: count="//SelfStudy" is exactly the same as count="SelfStudy", with the exception that it's considered poor form. There are times when the expressions are not the same, and if you wish to avoid problems you should understand the difference and prefer the simpler one when it will do.

Cheers,
Wendell

At 10:37 AM 8/19/2008, you wrote:

xsl:number does not output the numbering correctly. I have tried various
ways of using xsl:number and though I can get a letter to output instead of
a number, the sequence is wrong. Below are the various ways I have tried
using xsl:number and the output I received. Please excuse me for the length
of this post but I wanted to list all the different methods I had tried.
Also please note that after the 1st listing, I only noted the block that
contained the xls:number function rather than repeating the entire element
definition since nothing else had changed.


======================================================================
Wendell Piez                            mailto:wapiez@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================

Current Thread