9.3 XSD lexical forms
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
    • Packages
      • SWI-Prolog SGML/XML parser
        • Writing markup
          • XSD lexical forms
            • xsd_number_string/2
            • xsd_time_string/3
Availability::- use_module(library(sgml)).(can be autoloaded)
[det]xsd_number_string(?Number, ?String)
This predicate is similar to number_string/2, but accepts floating point numbers according to the XML syntax rather than the Prolog syntax. In particular, XML does not require a‘0' (zero) before and after the decimal dot and accepts the constants NaN and INF. If a Prolog float is converted into a string it returns the XML canonical form. This form always has one digit before the decimal dot, at least one digit after it and an exponential component using the capital E. This predicate behaves as number_string/2 for integers.

Throws a syntax_error(xsd_number) if String is given and is not a well-formed XSD number.