[xquery-talk] XQuery 3.0: formatting integers

Yoshi Okamoto yoshiokamoto at yahoo.com
Sun Mar 10 07:31:52 PST 2013


Dear readers,


I have a question regarding the new fn:format-integer() function of XQuery. I noticed that the implementations I tried give me different results for various queries. This is one example:

  format-integer(-1, '#####12.3')


The results are:

* Saxon: -0.0.1
* BaseX, XMLPrime: -00.1

* Zorba: -1

Does someone know what is the correct result? I spent about one hour in the Functions and Operators 3.0 specification to finally confess that I did not manage to sort out the relevant details. This is the text I read:

  http://www.w3.org/TR/xpath-functions-30/#func-format-integer

Maybe someone in the community is faster than me? Maybe someone even know the answer by heart? Maybe I should try more implementations? I assume that Michael Kay's Saxon processor is probably the implementation to trust most?

Thank you for reading this, and thank your for sharing your time,

Best regards
Yoshi OKAMOTO



More information about the talk mailing list