The "format-number" function has an implementation-biased behaviour

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P4
    • None
    • Affects Version/s: 6.0a
    • Component/s: xml

      File numberformat25.xsl contains the following lines:
      <xsl:decimal-format decimal-separator="!" grouping-separator="!" />
      <out><xsl:value-of select="format-number(931.4857,'###!###!###')"/></out>
      The result of transformation is: <?...?><out>931</out>
      Since a parser implementation can consider that first ! in pattern is either decimal-separator or grouping-separator the result will be either 931 or 931.485.
      Thus the parser bahaviour is implementation-biased.

      The xsl:decimal-format element has a lot of attributes that control the format of result:
      <xsl:decimal-format
        name = qname
        decimal-separator = char
        grouping-separator = char
        infinity = string
        minus-sign = char
        NaN = string
        percent = char
        per-mille = char
        zero-digit = char
        digit = char
        pattern-separator = char />
      Since the order of handling isn't specified the result of transformation is implementation-biased if a parser does not control that all attributes has distinct characters.
      It makes sense to add a control and throw an exception like this: The same character is used as the grouping-separator and as the decimal-separator

            Assignee:
            Joe Wang
            Reporter:
            Leonid Kuskov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: