Tamino XQuery User Guide - Software AG Documentation
Tamino XQuery User Guide - Software AG Documentation
Tamino XQuery User Guide - Software AG Documentation
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
The Nuts and Bolts of <strong>XQuery</strong><br />
NodeTest<br />
'*:name'<br />
'*'<br />
Description<br />
according to the axis used: all element or attribute nodes in the<br />
specified namespace with the specified local name (regardless<br />
of namespace)<br />
according to the axis used: all element or attribute nodes<br />
Predicates<br />
The last, optional part of a step is one or more predicates to filter the sequence of selected nodes<br />
according to the predicate expression. This expression is always enclosed in square brackets [ and<br />
]. A selected node is retained if the predicate truth value of the predicate expression evaluates to<br />
"true".<br />
The predicate truth value is derived by applying the following rules, in order:<br />
1. If the value of the predicate expression is an atomic value of a numeric type, the predicate truth<br />
value is true if the value of the predicate expression is equal to the context position, and is false<br />
otherwise.<br />
2. Otherwise, the predicate truth value is the effective boolean value of the predicate expression.<br />
The effective boolean value of an expression is false if its operand is any of the following:<br />
■ An empty sequence<br />
■ The boolean value false<br />
■ A zero-length value of type xs:string or xdt:untypedAtomic<br />
■ numeric value that is equal to zero<br />
Otherwise, fn:boolean returns "true".<br />
The filtered node sequence is ordered according to the direction of the selected axis.<br />
Data Types<br />
The <strong>XQuery</strong> type system is much richer than that of XPath 1.0. It uses the built-in data types as<br />
defined in XML Schema 1.0. The set of built-in data types consist of primitive types and derived<br />
types. They fall roughly into these categories:<br />
■ Boolean values (true and false)<br />
■ Numbers: decimals, floating-point numbers with single and double precision<br />
■ Character Strings<br />
■ Data types for dates, times, and durations (two of which are not yet defined in XML Schema)<br />
<strong>XQuery</strong> <strong>User</strong> <strong>Guide</strong><br />
29