From: Andre Cusson <ac@hy...> - 2004-02-11 13:20:33
Does anyone know of a workaround or alternative to the fact that, in Saxon
7.8, eval and evaluate do not support the format-number (xpath)
function. For run-time layout and/or rendering, it seems that a
number-formatting tool is indispensable. How else can you get numeric
values formatted ? Tightly coupling with some run-time scripts (ex:ECMA)
may achieve some functionality but it does not seem very pretty or
efficient. format-number offers great flexibility and would do the job
very well. There must have been some good logic that lead to the removal
of this functionality between Saxon 6.5.3 and Saxon 7.8 and, of course,
re-considering format-number in eval/evaluate may bring-up some more issues
but, is there an alternative ? How can I render run-time formatted numbers
without format-number ?
From: Andre Cusson <ac@hy...> - 2004-02-11 15:25:02
I can get around my problem by simply preformatting the numbers in the
static context and providing a formatted string to the dynamic context.
Although it is sad not to have access to format-number in the dynamic
context and although it may not always be so easy to get around not having
it, especially if you need to do calculations on those numbers, in the
dynamic context, I understand and respect the design choice. It is too bad
that format-number is part of the XSLT context and not of XPATH.
At 08:53 AM 2/11/2004, you wrote:
> > Does anyone know of a workaround or alternative to the fact
> > that, in Saxon
> > 7.8, eval and evaluate do not support the format-number (xpath)
> > function.
>Can't you return the number to the XSLT code, and format it from within
> > There must have been some good logic that lead to
> > the removal of this functionality between Saxon 6.5.3 and Saxon 7.8
>There were quite a few edge cases in evaluate() where the static and
>dynamic context weren't very well-defined, and I decided to make it pure
>XPath, with no access to the XSLT context, simply because that was
>well-specified and it meant I could use the standalone XPath engine in
>The SF.Net email is sponsored by EclipseCon 2004
>Premiere Conference on Open Tools Development and Integration
>See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
>saxon-help mailing list
From: Andre Cusson <ac@hy...> - 2004-02-11 19:09:15
Finally, I have to add a command to the layout vocabulary to replace the
format-number invocations and return to the static context to format the
value, then returning to the dynamic. It is more convoluted but it fixes
the problem soon, allows real-time calculations to be performed relatively
easily on the values and opens up some new possibilities. You where right.
Why wasn't format-number included in XPATH (so many dates, so little number
formatting ...) ?
From: Michael Kay <mhk@mh...> - 2004-02-11 21:07:35
> Why wasn't format-number included in XPATH (so many dates, so
> little number formatting ...) ?
We did look at it, but the XSLT spec was considered too heavyweight, and
no-one came up with anything lighter.