Output Module

From BaseX Documentation
Jump to navigation Jump to search

This XQuery Module contains functions for simplifying formatted data output.

Conventions[edit]

All functions and errors in this module are assigned to the http://basex.org/modules/out namespace, which is statically bound to the out prefix.

Functions[edit]

out:cr[edit]

Signatures out:cr() as xs:string
Summary Returns a single carriage return character (
).

out:nl[edit]

Signatures out:nl() as xs:string
Summary Returns a single newline character (
).

out:tab[edit]

Signatures out:tab() as xs:string
Summary Returns a single tabulator character (	).

out:format[edit]

Signatures out:format($format as xs:string, $items as item() ...) as xs:string
Summary Returns a formatted string. The remaining arguments specified by $items are applied to the $format string, according to Java’s printf syntax.
Errors format: The specified format is not valid.
Examples
  • out:format("%b", true()) returns true.
  • out:format("%06d", 256) returns 000256.
  • out:format("%e", 1234.5678) returns 1.234568e+03.

Errors[edit]

Code Description
format The specified format is not valid.

Changelog[edit]

Version 9.0
  • Added: out:cr
  • Updated: error codes updated; errors now use the module namespace

Introduced with Version 7.3. Functions have been adopted from the obsolete Utility Module.