xsl-list
[Top] [All Lists]

xsl:number

2003-03-16 22:49:34
I have questions about xsl:number. This is the most poorly specified
instruction I've come across. It's really hard to even know what questions to
ask.

The way I interpret the XSLT 1.0 spec (and the 2.0 draft doesn't help),

  <xsl:number format="A"/>

must be supported, and it must produce something from the sequence

  A, B, C, ..., Z, AA, AB, AC, ...

where A=1, B=2, etc.
 
The way it is specified, it seems to indicate that the alphabet must be the
English alphabet: ABCDEFGHIJKLMNOPQRSTUVWXYZ.

Or perhaps it could be any alphabet that starts with ABC and ends with Z, like
the Spanish alphabet, which varies depending on who you ask, but for computing
purposes I think is generally ABCDEFGHIJKLMNÑOPQRSTUVWXYZ.

Or perhaps everything after "A" is just an example, meaning that it very well
could be the Swedish alphabet: ABCDEFGHIJKLMNOPQRSTUVWXYZÅÄÖ ... or perhaps
Vietnamese, which starts with A and has no Z.

Anyway, the implication is that a processor must support some alphabet that
contains "A". Or is "A" just a placeholder for any alphabetic character?

"When numbering with an alphabetic sequence, the lang attribute specifies
which language's alphabet is to be used; it has the same range of values as
xml:lang [XML]; if no lang value is specified, the language should be
determined from the system environment."

It seems to me that if format="A", then the value of lang, whether determined
by the processor or specified in the stylesheet, must be a language that
contains "A".

What happens if the processor supports both English and Hebrew, and I do
something like

  <xsl:number format="A" lang="he"/>

? Or for that matter,

  <!-- #1488 = Hebrew letter Aleph -->
  <xsl:number format="&#1488;" lang="en"/>
  
?

What does

  <xsl:number format="B"/>

mean? At the very least, I know "B" must represent 1. If the default language
is English, does this mean the sequence must be

  B, C, D, ..., Z, BB, BC, BD, ...

?

The spec also says format="I" must be supported by using Roman numerals. What
does format="I" mean when the language is not English?

The spec says "In many languages there are two commonly used numbering
sequences that use letters. One numbering sequence assigns numeric values to
letters in alphabetic sequence, and the other assigns numeric values to each
letter in some other manner traditional in that language. In English, these
would correspond to the numbering sequences specified by the format tokens a
and i."

This seems to indicate that using "I" for Roman is a "traditional" English
convention, and (reading further) that I could use letter-value="alphabetic"
to override this interpretation. If my theory about format="B" is correct,
then format="I" with letter-value="alphabetic" would result in I, J, K, ...
sequences.

I don't know. I have more questions, but I'll just stop here. I really hope
this stuff gets cleared up in 2.0, although that doesn't help me much in
trying to properly implement 1.0.

Mike

-- 
  Mike J. Brown   |  http://skew.org/~mike/resume/
  Denver, CO, USA |  http://skew.org/xml/

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



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