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

Building Queries and Data Views

 Previous Next Contents Index View as PDF  

About in Liquid Data XQuery Functions

You can browse the Liquid Data XQuery function in the Data View Builder. The functions are located in Design tab —> Toolbox tab —> XQuery Functions. You can also make your own custom functions. This section describes the conventions used in the Liquid Data XQuery functions and describes the XQuery data types.

Naming Conventions

The xf: prefix is a W3C XML naming convention, also known as a namespace. Liquid Data supports extended functions that are enhancements to the XQuery specification, which you can recognize by their extended function prefix xfext:. For example, the full XQuery notation for an extended function is xfext:function_name. Extended functions accept standard input types, but they are limited to single values.

Liquid Data also supports extensions to XQuery data types that are designated with xsext:datatype notation. When you encounter the xsext: prefix, it means that the data type may have Liquid Data-imposed restrictions that are necessary to interface successfully with the Liquid Data Server.

The xfext: prefix identifies an extended function. The prefix identifies the type of function to you but the Data View Builder does not recognize or process the prefix.

Occurrence Indicators

An occurrence indicator indicates the number of items in a sequence. This notation usually appears on a parent node in a schema. Use these identifiers to determine the repeatability of a node.

These occurrence indicators also communicate information about the data type when they appear in a function signature. For example:

Data Types

Every data element or variable has a data type. Function parameters have data type requirements and the function result is returned as a data type. The following table describes other data types that conform to the XQuery specification. Current compliance with the W3C XQuery specification extends to XQuery 1.0 and XPath 2.0 Functions and Operators specification dated 30 April 2002. Another helpful reference is XML Schema Part 2: Datatypes.

Table A-1 Data Types

Data Type Name

Description

xs:anyType

Represents the most generic data type. All data types including anyAttribute, anyElement, anySimpleType, anyValue, as well as sequences, items, nodes, strings, decimals.

xsext:anyValue

A subset of xs:anyType including dateTime, boolean, string, numeric values, or any single value. Does not include anyAttribute, anyElement, item, node, sequence, or anySimpleType.

xs:boolean

A subset of xsext:anyValue. A value that supports the mathematical concept of binary-valued logic: true or false.

xs:byte

A subset of xs:short. A sequence of decimal digits (0-9) with a range of 127 to -128. If the sign is omitted, plus  (+) is assumed.

Examples: -1, 0, 126, +100

xs:date

A subset of xsext:anyValue. Represents the leftmost component of dateTime YYYY-MM-DD where:

  • YYYY is the year

  • MM is the month

  • DD is the day

May be preceded by a leading minus  (-) sign to indicate a negative number. If the sign is omitted, plus  (+) is assumed.

May be immediately followed by a Z to indicate Coordinated Universal Time (UTC) or, to indicate the time zone (the difference between the local time and Coordinated Universal Time), immediately followed by a sign, + or -, followed by the difference from UTC represented as hh:mm.

Example:

To specify 1:20 pm on May the 31st, 1999, write: 1999-05-31.

xs:dateTime

A subset of xsext:anyValue. Represents the format YYYY-MM-DDThh:mm:ss where:

  • YYYY is the year

  • MM is the month

  • DD is the day

  • T is the date/time separator

  • hh is the hour

  • mm is the minute

  • ss is the second

May be preceded by a leading minus  (-) sign to indicate a negative number. If the sign is omitted, plus  (+) is assumed. Additional digits can be used to increase the precision of fractional seconds if desired (ss.ss...) with any number of digits after the decimal point is supported.

May be immediately followed by a Z to indicate Coordinated Universal Time (UTC) or, to indicate the time zone (the difference between the local time and Coordinated Universal Time), immediately followed by a sign, + or -, followed by the difference from UTC represented as hh:mm.

Example:

To specify 1:20 pm on May the 31st, 1999 EST, which is five hours behind Coordinated Universal Time (UTC), write: 1999-05-31T13:20:00-05:00.

xs:decimal

A subset of xsext:anyValue. Includes all integer types, such as xs:integer, xs:long, xs:short, xs:int, or xs:byte.

Represents a finite-length sequence of decimal digits (0-9) separated by an optional period as a decimal indicator. An optional leading sign is allowed. If the sign is omitted, plus  (+) is assumed. Leading and trailing zeroes are optional. If the fractional part is zero, the period and following zeroes can be omitted.

Examples: -1.23, 12678967.543233, +100000.00, 210

xs:double

A subset of xsext:anyValue. There are no subordinate data types; however, xs:float and xs:decimal, and all derived types, can be promoted to xs:double in certain cases, such as function calls.

Represents a double precision 64-bit floating point value. Supports the special values positive and negative zero, positive and negative infinity and not-a-number (0, -0, INF, -INF and NaN).

xs:float

A subset of xsext:anyValue. There are no subordinate data types; however, xs:decimal, and all derived types, can be promoted to xs:float in certain cases, such as function calls.

Represents a single-precision 32-bit floating point value. Supports the special values positive and negative zero, positive and negative infinity and not-a-number (0, -0, INF, -INF and NaN).

xsext:item

A subset of xs:anyType. Includes xsext:anyValue and xsext:node. Excludes any sequence. Represents a list element, individual value, or attribute.

xs:int

A subset of xs:long. Represents a finite-length sequence of decimal digits (0-9). An optional leading sign is allowed. If the sign is omitted, plus  (+) is assumed.

Examples: -1, 0, 12678967543233, +100000

xs:integer

A subset of xs:decimal. Represents a finite-length sequence of decimal digits (0-9). An optional leading sign is allowed. If the sign is omitted, plus  (+) is assumed.

Examples: -1, 0, 12678967543233, +100000

xs:long

A subset of xs:decimal. A sequence of decimal digits (0-9) with a range of 9223372036854775807 to -9223372036854775808. If the sign is omitted, plus  (+) is assumed.

Examples: -1, 0, 12678967543233, +100000

xsext:node

A subset of xsext:anyValue. A component in a tree structure that represents a data element.

xs:short

A subset of xs:int. A sequence of decimal digits (0-9) with a range of 32767 to -32768. If the sign is omitted, plus  (+) is assumed.

Examples: -1, 0, 12678, +10000

xs:string

A subset of xsext:anyValue. A sequence that contains alphabetic, numeric, or special characters.

xs:time

A subset of xsext:anyValue. Represents the rightmost segment of the dateTime format where:

  • hh is the hour

  • mm is the minute

  • ss is the second

May contain an optional following time zone indicator.

Examples:

  • To indicate 1:20 pm EST, which is five hours behind Coordinated Universal Time (UTC), write: 13:20:00-05:00.

  • Midnight is 00:00:00.


 

Date and Time Patterns

You can construct date and time patterns using standard Java class symbols. The following table shows the pattern symbols you can use.

Table 9-3 Date and Time Patterns

This Symbol

Represents This Data

Produces This Result

G

Era

AD

y

Year

1996

M

Month of year

July, 07

d

Day of the month

19

h

Hour of the day (1-12)

10

H

Hour of the day (0-23)

22

m

Minute of the hour

30

s

Second of the minute

55

S

Millisecond

978

E

Day of the week

Tuesday

D

Day of the year

27

w

Week in the year

27

W

Week in the month

2

a

am/pm marker

AM, PM

k

Hour of the day (1-24)

24

K

Hour of the day (0-11)

0

z

Time zone

Pacific Standard Time

Pacific Daylight Time


 

Repeat each symbol to match the maximum number of characters required to represent the actual value. For example, to represent 4 July 2002, the pattern is d MMMM yyyy. To represent 12:43 PM, the pattern is hh:mm a.

 

Back to Top Previous Next