+Sun Oct 14 17:17:03 CEST 2001 Thomas Broyer <tbroyer@ltgt.net>
+
+ * libxslt/numbers.c tests/REC/test-7.7-4.out: implement initial
+ non-alphanumeric token handling in number formatting.
+
Wed Oct 10 11:58:41 CEST 2001 Daniel Veillard <daniel@veillard.com>
* configure.in: releasing 1.0.5
default_token.token = (xmlChar)'0';
default_token.width = 1;
default_token.filling = BAD_CAST(".");
-
- for (cnt = 0; cnt < array_max; cnt++) {
+
+ /*
+ * Parse initial non-alphanumeric token
+ * Always use an empty token for that
+ */
+ while (! (IS_LETTER(format[index]) || IS_DIGIT(format[index]))) {
+ if (format[index] == 0)
+ break; /* while */
+ index++;
+ }
+ if (index > 0)
+ array[0].filling = xmlStrndup(format, index);
+ else
+ array[0].filling = NULL;
+
+ for (cnt = 1; cnt < array_max; cnt++) {
if (format[index] == 0) {
break; /* for */
} else if (IS_DIGIT_ONE(format[index]) ||
int is_last_default_token = 0;
minmax = (array_max >= numbers_max) ? numbers_max : array_max;
+
+ /*
+ * Handle initial non-alphanumeric token
+ */
+ token = &(*array)[0];
+ if (token->filling != NULL)
+ xmlBufferCat(buffer, token->filling);
+
for (i = 0; i < numbers_max; i++) {
/* Insert number */
number = numbers[(numbers_max - 1) - i];
- if (i < array_max) {
- token = &(*array)[i];
- } else if (array_max > 0) {
+ if (i + 1 < array_max) {
+ token = &(*array)[i + 1];
+ } else if (array_max > 1) {
token = &(*array)[array_max - 1];
} else {
token = &default_token;
- <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">1) A note here</fo:block>
- <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">2) And here</fo:block>
+ <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">(1) A note here</fo:block>
+ <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">(2) And here</fo:block>
- <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">1) And another note here</fo:block>
+ <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">(1) And another note here</fo:block>