Output Module

From BaseX Documentation

Jump to: navigation, search

This XQuery Module contains functions for simplifying formatted data output.

Contents

[edit] Conventions

Updated with Version 9.0:

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.

[edit] Functions

[edit] out:cr

Intrduced with Version 9.0:

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

[edit] out:nl

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

[edit] out:tab

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

[edit] out:format

Signatures out:format($format as xs:string, $item1 as item(), ...) as xs:string
Summary Returns a formatted string. $item1 and all following 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.

[edit] Errors

Updated with Version 9.0:

Code Description
format The specified format is not valid.

[edit] Changelog

Version 9.0

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

Personal tools
Namespaces
Variants
Actions
Navigation
Print/export