picture string for format-number() function

Help
sh
2004-11-24
2012-10-08
  • sh

    sh - 2004-11-24

    hi!

    for a layout for a documentation i'm working with xslt and fop. because of the new functions of xslt2.0 and xpath2.0 i changed the xslt-processor to saxon 8.1.1..

    all the code works normal, exept the format-number()

    in the beginning i start with

    <xsl:decimal-format name="european" decimal-separator="," grouping-separator="." zero-digit="0" digit="#"/>

    afterwards i use

    <xsl:value-of select="format-number(.,'#.##0,##','european')" />

    with saxon 6.5.3 and xalan 2.6.0 the comma will displayed if the number have one.
    e.g.:
    0
    1,4
    10

    with saxon 8.1.1 all numbers have a comma
    e.g.:
    0,
    1,4
    10,

    i tested it with
    windows xp and java 1.4.2_06
    and
    suse linux and java 1.4.2_03

    are there other documentation about the picture string

    thanks

    stefan

     
    • Michael Kay

      Michael Kay - 2004-11-24

      I think that Saxon is behaving as the XSLT 2.0 specification says it should, but your example suggests that the spec should be improved. I'll put forward the suggestion. (format-number() was very poorly specified in XSLT 1.0, if Saxon and Xalan behave the same way then it's probably because they are both calling the same Java library methods).

      The old implementation remains available in Saxon under the name format-number-1.0() if you need it.

      Michael Kay

       
    • sh

      sh - 2004-11-25

      hello!

      thank you for quick response.

      it works.

      stefan

       

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks