DB2 10.5 for Linux, UNIX, and Windows

Atomic values

An atomic value is an instance of one of the built-in atomic data types that are defined by XML Schema. These data types include strings, integers, decimals, dates, and other atomic types. These types are described as atomic because they cannot be subdivided.

Unlike nodes, atomic values do not have an identity. Every instance of an atomic value (for example, the integer 7) is identical to every other instance of that value.

The following examples are some of ways that atomic values are made:
  • Extracted from nodes through a process called atomization. Atomization is used by expressions whenever a sequence of atomic values is required.
  • Specified as a numeric or string literal. Literals are interpreted by XQuery as atomic values. For example, the following literals are interpreted as atomic values:
    • "this is a string" (type is xs:string)
    • 45 (type is xs:integer)
    • 1.44 (type is xs:decimal)
  • Computed by constructor functions. For example, the following constructor function builds a value of type xs:date out of the string "2005-01-01":
    xs:date("2005-01-01")
  • Returned by the built-in functions fn:true() and fn:false(). These functions return the boolean values true and false. These values cannot be expressed as literals.
  • Returned by many kinds of expressions, such as arithmetic expressions and logical expressions.