bea.com | products | dev2dev | support | askBEA
 Download Docs   Site Map   Glossary 
Search

Building Queries and Data Views

 Previous Next Contents Index View as PDF  

Sequence Functions

A sequence is an ordered collection of zero or more items. An item may be a node or a simple typed value. Therefore, a sequence can be an ordered collection of nodes, a collection of simple typed values, or any mix of nodes and simple typed values. Sequences may not contain other sequences but may contain duplicate items. There is no difference between a single item, such as a node or a simple typed value, and a sequence containing that single item.

xf:distinct-values

If the source value contains only nodes, the function removes duplicates and returns a subset of unique values.

Data Types

Notes

The Liquid Data xf:distinct-values function varies from the standard XQuery function by removing duplicates from the result.

If the source value is an empty list, the function returns an empty list.

XQuery Specification Compliance

Examples

 


xf:empty

Returns true if the specified list of items is empty; otherwise, returns false.

Data Types

XQuery Specification Compliance

Liquid Data supports an optional boolean returned value.

Examples

 


xf:subsequence (format 1)

Returns the contiguous sequence of items described by Parameter 1 beginning at the position indicated by the Parameter 2 and continuing until the end of the sequence.

Data Types

Notes

The first item of a sequence is located at position 1, not position 0.

If you omit the length parameter, the function returns all items up to the end of the source sequence.

If the starting location is greater than the number of items in the sequence, the function returns an empty list.

If the item list is empty, Liquid Data returns an empty list.

XQuery Specification Compliance

Examples

 


xf:subsequence (format 2)

Returns the contiguous sequence of items described by Parameter 1 beginning at the position indicated by the Parameter 2 and continuing for the number of items indicated by the value of Parameter 3.

Data Types

Notes

The value of Parameter 2 can be greater than the number of items in the value of Parameter  1, in which case the subsequence includes items to the end of Parameter 3.

If the sum of the starting location and the length parameter is greater than the length of the source sequence, the function returns all items up to the end of the sequence.

The first item of a sequence is located at position 1, not position 0.

If the starting location is greater than the number of items in the sequence, the function returns an empty list.

If the item list is an empty list, Liquid Data returns an empty list.

Liquid Data is able to process either format of xf:subsequence. Adding a third parameter automatically invokes Format 2.

XQuery Specification Compliance

Examples

 

Back to Top Previous Next