Introducing the all-new TIBCO Community site!

For current users, please click "Sign In" to reset your password and access the enhanced features. If you're a first-time visitor, we extend a warm welcome—click "Sign Up" to become a part of the TIBCO Community!

If you're seeking alternative community sites, explore ibi, Jaspersoft, and Spotfire.

Jump to content
  • Xpath/xquery functions support by TIBCO ActiveMatrix BusinessWorks? engine


    Manoj Chaurasia

    These functions are supported by the TIBCO ActiveMatrix BusinessWorks? engine. Not all are currently supported by the mapper GUI and so you may see mapper warnings (i.e. "No such function."), but they should work at runtime.

    These are thoroughly documented in the specs: http://www.w3.org/TR/xpath and http://www.w3.org/TR/xquery-operators/

    Category

    Function Name

    Function Signature

    Version

    Summary

    Examples

    binary

    hex-to-string

    hex-to-string( hexEncodedString , optEncoding )

    tib

    Converts a hex binary encoded string into a string using the specified character encoding.
    If not specified, the default encoding, UTF-8, is used.

    hex-to-string('48656C6C6F20576F726C64') = Hello World

    binary

    base64-to-hex

    base64-to-hex( base64EncodedString )

    tib

    Converts a base64 binary encoded string into a hex encoded string.

    base64-to-hex('SGVsbG8gV29ybGQ=') = 48656C6C6F20576F726C64

    binary

    hex-to-base64

    hex-to-base64( hexEncodedString )

    tib

    Converts a hex binary encoded string into a base64 encoded string.

    hex-to-base64('48656C6C6F20576F726C64') = SGVsbG8gV29ybGQ=

    binary

    base64-to-string

    base64-to-string( base64EncodedString , optEncoding )

    tib

    Converts a base64 binary encoded string into a string using the specified encoding.
    If not specified, the default encoding, UTF-8, is used.

    base64-to-string('SGVsbG8gV29ybGQ=') = Hello World

    binary

    hex-length

    hex-length( hexEncodedString )

    tib

    Gets the binary length, in bytes, of the specified hex binary encoded string.

    hex-length('48656C6C6F20576F726C64') = 11

    binary

    string-to-base64

    string-to-base64( string , optEncoding )

    tib

    Converts a string into a base64 encoded string using the specified character encoding.
    If not specified, the default encoding, UTF-8, is used.

    string-to-base64('Hello World') = SGVsbG8gV29ybGQ=

    binary

    base-length

    base64-length( base64EncodedString )

    tib

    Gets the binary length, in bytes, of the specified base64 binary encoded string.

    base64-length('SGVsbG8gV29ybGQ=') = 11

    binary

    string-to-hex

    string-to-hex( string , optEncoding )

    tib

    Converts a string into a hex encoded string using the specified character encoding.
    If not specified, the default encoding, UTF-8, is used.

    string-to-base64('Hello World') = 48656C6C6F20576F726C64

    comparison

    compare

    compare( comparand1 , comparand2 )

    2.0

    Compares two objects, returning -1, 0, or 1, depending on whether the value of the $comparand1 is respectively less than, equal to, or greater than the value of $comparand2.

    compare('abc', 'abc') = 0

    conditionsiteration

    if

    if ( test ) then then else else

    2.0

    Conditionally evaluates either the then-expression or the else-expression based on the boolean value of the test-expression.

    if (time>500) then 'too long' else 'ok' = too long -- when time > 500

    datetime

    current-datetime

    current-dateTime()

    2.0

    Returns the current local time with the UTC offset as a dateTime string.

    current-dateTime() = 2002-12-16T16:20:10+04:00

    datetime

    current-date

    current-date()

    2.0

    Returns the current local date with the UTC offset as a date string.

    current-date() = 2002-12-16+04:00

    datetime

    validate-datetime

    validate-dateTime( format , string )

    tib

    Validates the date using the format string.

    validate-dateTime('EEE MMM dd HH:mm:ss yyyy', 'Sat Sep 12 04:10:33 1970') = true

    datetime

    get-century-from-date

    get-century-from-date( string )

    tib

    Extracts the century as a number from a string with XML Schema date datatype.
    The date encoding is based on the ISO 8601 reduced format (CCYY-MM-DD) with optional
    timezone.

    get-century-from-date('1999-05-31') = 19

    datetime

    get-minutes-from-time

    get-minutes-from-time( string )

    tib

    Extracts the minutes as a number from a string with XML Schema time datatype.
    The minutes value ranges from 0 to 59 inclusive. The time is the left truncated lexical representation for dateTime (hh:mm:ss.ssss) with optional timezone.

    get-minutes-from-time('13:20:00-05:00') = 20

    datetime

    get-day-from-date

    get-day-from-date( string )

    tib

    Extracts the day as a number from a string with XML Schema date datatype.
    The date encoding is based on the ISO 8601 reduced format (CCYY-MM-DD) with optional
    timezone.

    get-day-from-date('1999-05-31') = 31

    datetime

    timestamp

    timestamp()

    tib

    Gets the time, in milliseconds from midnight, January 1, 1970 UTC, at the instance of the call to this function.

     

    datetime

    add-to-time

    add-to-time( time , hours-offset , minutes-offset , seconds-offset )

    tib

    Adds a number of hours, minutes, and seconds to the specified time.

    add-to-time('08:24:55',1,2,3) = 09:26:58
    add-to-time('08:24:55',-1,-2,-3) = 07:22:52

    datetime

    get-year-from-date

    get-year-from-date( string )

    tib

    Extracts the year as a number from a string with XML Schema date datatype.
    The date encoding is based on the ISO 8601 reduced format (CCYY-MM-DD) with optional
    timezone.

    get-year-from-date('1999-05-31') = 1999

    datetime

    get-timezone-from-time

    get-timezone-from-time( string )

    tib

    Extracts the timezone as a string from a string with XML Schema time datatype.
    The time is the left truncated lexical representation for dateTime (hh:mm:ss.ssss) with optional timezone.

    get-timezone-from-time('13:20:05-05:00') = -05:00

    datetime

    compare-datetime

    compare-dateTime( dateTime1 , dateTime2 )

    tib

    Compares 2 date-times, returns -1 if first < second, 1 if second < first, or 0 if equal.

    compare-dateTime('1980-08-05T08:24:55', '1980-09-04T08:24:55') = -1

    datetime

    get-minutes-from-datetime

    get-minutes-from-dateTime( string )

    tib

    Extracts the minutes as a number from a string with XML Schema dateTime datatype.
    The minutes value ranges from 0 to 59 inclusive. The dateTime encoding is based on the ISO 8601 extended format (CCYY-MM-DDThh:mm:ss) with optional
    timezone.

    get-minutes-from-dateTime('1999-05-31T13:20:00-05:00') = 20

    datetime

    get-seconds-from-time

    get-seconds-from-time( string )

    tib

    Extracts the seconds and milliseconds as a number from a string with XML Schema time datatype.
    The seconds value ranges from 0 to 59 inclusive. The time is the left truncated lexical representation for dateTime (hh:mm:ss.ssss) with optional timezone.

    get-seconds-from-time('13:20:05-05:00') = 5

    datetime

    create-datetime

    create-dateTime( year , month , day , hours , minutes , seconds )

    tib

    Creates a date time string from the list of integer parameters. Expecting the following
    parameters in order: year, month, day, hour, minutes, seconds, [milliseconds].

    create-dateTime(2002, 12, 16, 16, 20, 10) = 2002-12-16T16:20:10

    datetime

    get-timezone-from-datetime

    get-timezone-from-dateTime( string )

    tib

    Extracts the timezone as a string from a string with XML Schema dateTime datatype.
    The dateTime encoding is based on the ISO 8601 extended format (CCYY-MM-DDThh:mm:ss) with optional
    timezone.

    get-timezone-from-dateTime('1999-05-31T13:20:05-05:00') = -05:00

    datetime

    get-year-from-datetime

    get-year-from-dateTime( string )

    tib

    Extracts the year as a number from a string with XML Schema dateTime datatype.
    The dateTime encoding is based on the ISO 8601 extended format (CCYY-MM-DDThh:mm:ss) with optional
    timezone.

    get-year-from-dateTime('1999-05-31T13:20:00-05:00') = 1999

    datetime

    get-day-from-datetime

    get-day-from-dateTime( string )

    tib

    Extracts the day as a number from a string with XML Schema dateTime datatype.
    The dateTime encoding is based on the ISO 8601 extended format (CCYY-MM-DDThh:mm:ss) with optional
    timezone.

    get-day-from-dateTime('1999-05-31T13:20:00-05:00') = 31

    datetime

    get-hours-from-datetime

    get-hours-from-dateTime( string )

    tib

    Extracts the hour as a number from a string with XML Schema dateTime datatype.
    The hour value ranges from 0 to 23 inclusive. The dateTime encoding is based on the ISO 8601 extended format (CCYY-MM-DDThh:mm:ss) with optional
    timezone.

    get-hours-from-dateTime('1999-05-31T13:20:00-05:00') = 13

    datetime

    add-to-date

    add-to-date( date , years-offset , months-offset , days-offset )

    tib

    Adds a number of years, months, and days to the specified date.

    add-to-date('1999-05-31',0,0,4) = 1999-06-04
    add-to-date(parse-date('MMM dd yyyyy','Jul 05 1997'),1,0,-5) = 1998-06-30

    datetime

    compare-time

    compare-time( time1 , time2 )

    tib

    Compares 2 times, returns -1 if first < second, 1 if second < first, or 0 if equal.

    compare-time('08:24:55', '07:24:55') = 1

    datetime

    get-timezone-from-date

    get-timezone-from-date( string )

    tib

    Extracts the timezone as a string from a string with XML Schema date datatype.
    The date encoding is based on the ISO 8601 extended format (CCYY-MM-DD) with optional timezone.

    get-timezone-from-date('1999-05-31-05:00') = -05:00

    datetime

    create-time

    create-time( hours , minutes , seconds )

    tib

    Creates a time string from the list of integer parameters. Expecting the following
    parameters in order: hour, minutes, seconds, [milliseconds].

    create-time(16, 20, 10) = 16:20:10

    datetime

    format-datetime

    format-dateTime( format , dateTime )

    tib

    Formats the given dateTime string into a new string following the conventions of the format string.
    You can find a complete description of the formats available in the XPath chapter of the TIBCO BusinessWorks Process Design Guide.

    format-dateTime('EEE MMM dd HH:mm:ss zzz yyyy', '1970-09-12T04:10:33-08:00') = Sat Sep 12 04:10:33 GMT-08:00 1970

    datetime

    format-time

    format-time( format , time )

    tib

    Formats the given time string into a new string following the conventions of the format string.
    You can find a complete description of the formats available in the XPath chapter of the TIBCO BusinessWorks Process Design Guide.

    format-time('HH mm ss', '04:10:33') = 04 10 33

    datetime

    add-to-datetime

    add-to-dateTime( date-time , years-offset , months-offset , days-offset , hours-offset , minutes-offset , seconds-offset )

    tib

    Adds a number of years, months, days, hours, minutes, and seconds to the specified date time.

    add-to-dateTime('1980-08-05T08:24:55',-1,-2,-3,1,2,3) = 1979-06-02T09:26:58

    datetime

    parse-time

    parse-time( format , string )

    tib

    Parses the given string into a time string using the format string.
    You can find a complete description of the formats available in the XPath chapter of the TIBCO BusinessWorks Process Design Guide.

    parse-time('EEE MMM dd HH:mm:ss yyyy', 'Sat Sep 12 04:10:33 1970') = 04:10:33

    datetime

    get-month-from-date

    get-month-from-date( string )

    tib

    Extracts the month as a number from a string with XML Schema date datatype.
    The date encoding is based on the ISO 8601 reduced format (CCYY-MM-DD) with optional
    timezone.

    get-month-from-date('1999-05-31') = 5

    datetime

    get-hours-from-time

    get-hours-from-time( string )

    tib

    Extracts the hour as a number from a string with XML Schema time datatype.
    The hour value ranges from 0 to 23 inclusive. The time is the left truncated lexical representation for dateTime (hh:mm:ss.ssss) with optional timezone.

    get-hours-from-time('13:20:00-05:00') = 13

    datetime

    compare-date

    compare-date( date1 , date2 )

    tib

    Compares 2 dates, returns -1 if first < second, 1 if second < first, or 0 if equal.

    compare-date('1980-08-05', '1980-09-04') = -1

    datetime

    translate-timezone

    translate-timezone( dateTime , timezone )

    tib

    Translates a given ISO 8601 dateTime from the given timezone into the specified timezone or timezone offset. Daylight savings will be accounted for when given the appropriate timezone. Please see the list of valid timezones in the constants list. Note: the absolute time stays the same, only the timezone is changed.

    translate-timezone('2004-04-05T12:00:00Z', '-08:00') = 2004-04-05T05:00:00-07:00
    translate-timezone('2003-04-04T12:00:00Z', 'PST') = 2003-04-04T04:00:00-08:00

    datetime

    format-date

    format-date( format , date )

    tib

    Formats the given date string into a new string following the conventions of the format string.
    You can find a complete description of the formats available in the XPath chapter of the TIBCO BusinessWorks Process Design Guide.

    format-date('EEE MMM dd zzz yyyy', '1970-09-12-08:00') = Sat Sep 12 GMT-08:00 1970

    datetime

    create-datetime-timezone

    create-dateTime-timezone( year , month , day , hours , minutes , seconds , hours offset , minutes offset )

    tib

    Creates a date time string with a time zone from the list of integer parameters. Expecting the following
    parameters in order: year, month, day, hour, minutes, seconds, [milliseconds], hours Offset, minutes Offset.

    create-dateTime-timezone(2002, 12, 16, 16, 20, 10, 8, 30) = 2002-12-16T16:20:10+08:30

    datetime

    get-seconds-from-datetime

    get-seconds-from-dateTime( string )

    tib

    Extracts the seconds and milliseconds as a number from a string with XML Schema dateTime datatype.
    The seconds and milliseconds value ranges from 0.0 to 59.99 inclusive. The dateTime encoding is based on the ISO 8601 extended format (CCYY-MM-DDThh:mm:ss) with optional
    timezone.

    get-seconds-from-dateTime('1999-05-31T13:20:05-05:00') = 5

    datetime

    parse-date

    parse-date( format , string )

    tib

    Parses the given string into a date string using the format string.
    You can find a complete description of the formats available in the XPath chapter of the TIBCO BusinessWorks Process Design Guide.

    parse-date('EEE MMM dd HH:mm:ss yyyy', 'Sat Sep 12 04:10:33 1970') = 1970-09-12

    datetime

    get-century-from-datetime

    get-century-from-dateTime( string )

    tib

    Extracts the century as a number from a string with XML Schema dateTime datatype.
    The dateTime encoding is based on the ISO 8601 extended format (CCYY-MM-DDThh:mm:ss) with optional
    timezone.

    get-century-from-dateTime('1999-05-31T13:20:00-05:00') = 19

    datetime

    create-date

    create-date( year , month , day )

    tib

    Creates a date string from the list of integer parameters. Expecting the following
    parameters in order: year, month, day.

    create-dateTime(2002, 12, 16) = 2002-12-16

    datetime

    parse-datetime

    parse-dateTime( format , string )

    tib

    Parses the given string into a dateTime string using the format string.
    You can find a complete description of the formats available in the XPath chapter of the TIBCO BusinessWorks Process Design Guide.

    parse-dateTime('EEE MMM dd HH:mm:ss yyyy', 'Sat Sep 12 04:10:33 1970') = 1970-09-12T04:10:33

    datetime

    current-datetime-timezone

    current-dateTime-timezone( hours offset , minutes offset )

    tib

    Returns the current local time with the UTC offset as a dateTime string with the time zone.

    current-dateTime-timezone(8, 30) = 2002-12-16T16:20:10+08:30

    datetime

    get-month-from-datetime

    get-month-from-dateTime( string )

    tib

    Extracts the month as a number from a string with XML Schema dateTime datatype.
    The dateTime encoding is based on the ISO 8601 extended format (CCYY-MM-DDThh:mm:ss) with optional
    timezone.

    get-month-from-dateTime('1999-05-31T13:20:00-05:00') = 5

    general

    parentheses

    ( expression )

    1.0

    Parentheses surround expressions to delimit their scope.

    (a and b) and (c or d)

    general

    trace

    trace( $value as item()* , label-string )

    2.0

    The input $value is returned, unchanged, as the result of the function. In addition, the inputs $value, converted to an xs:string, and $label may be directed to a trace data set.

    trace($v, 'the value of $v is:')) = $v

    general

    generate-id

    generate-id( node-set )

    2.0

    Returns a string that uniquely identifies the node in the argument node-set.

    generate-id(node-set) = a unique identifier for the node set

    general

    key

    key( key-qname , key-value )

    2.0

    Returns the nodes with the given key.

    key("ns1:keyname", ".") = nodes with the given key

    general

    root

    root( node )

    2.0

    Returns the root of the tree to which $arg belongs; if the function is called without an argument, the context item (.) is used as the default argument.

    root(node) = root of the tree to which the node parameter belongs

    logical

    boolean

    boolean( object )

    1.0

    Returns true or false depending upon the datatype of the parameter.
    For strings, returns true when the string length is greater than zero.
    For node sets, returns true if the node set is not empty.
    For numbers, returns true if the number is not zero or not a number (NaN).

    boolean("A string") = true
    boolean($Order/Amt) = true if the node Amt is not zero.
    boolean($Order/ItemLst) = true if the node set ItemLst is not empty.

    logical

    true

    true()

    1.0

    Always returns true.

    true() = true

    logical

    false

    false()

    1.0

    Always returns false.

    false() = false

    logical

    lang

    lang( a language )

    1.0

    Returns true if the language specified by the xml:lang for the evaluation context node is the same as the parameter, ignoring case.

    lang("en") = true if en is specified for xml:lang in the evaluation context.

    logical

    not

    not( a boolean )

    1.0

    Returns true if the parameter is false, and false otherwise.

    not($Order/Amt > 50) = false if $Order/Amt is greater than 50, true if the order is less than 50.

    logical

    xor

    xor( boolean1 , boolean2 )

    tib

    Returns the logical exclusive-or of the two parameters.

    xor(true(), true()) = false
    xor(true(), false()) = true

    number

    sum

    sum( node-set )

    1.0

    Returns the sum of the values of the elements in a node set. If the elemets are strings, they are converted to numbers first.

    sum($Order/Items/Amt) = The sum of the values for the Amt node in the repeating element Items.

    number

    floor

    floor( a number )

    1.0

    Returns the largest integer that is not greater than the parameter.

    floor(5.876) = 5

    number

    number

    number( object )

    1.0

    Converts the parameter into a number. If the parameter is a node set, the first node's content is converted to a string first. Any parameter that is not a valid number returns NaN (not a number).

    number(substring-before($Customer/Street,' ')) = The street address number stored in the $Customer/Street node.

    number

    round

    round( a number )

    1.0

    Returns the closest integer to the parameter, rounding up if there are two integers equally close to the number.

    round(5.5) = 6

    number

    ceiling

    ceiling( a number )

    1.0

    Returns the smallest integer that is not less than or equal to the parameter.

    ceiling(5.876) = 6

    number

    avg

    avg( node-set of numbers )

    2.0

    Returns the average of all of the values in a node set. If the elements are strings, they are converted to numbers first.

    avg($Order/Items/Amt) = The average the values for the Amt node in the repeating element Items.

    number

    abs

    abs( arg-numeric )

    2.0

    Returns the absolute value of the argument.

    abs(-10.5) = 10.5

    number

    max

    max( node-set of numbers )

    2.0

    Returns the maximum of any of the values in a node set. If the elements are strings, they are converted to numbers first.

    max($Order/Items/Amt) = The maximum of the values for the Amt node in the repeating element Items.

    number

    min

    min( node-set of numbers )

    2.0

    Returns the minimum of any of the values in a node set. If the elements are strings, they are converted to numbers first.

    min($Order/Items/Amt) = The minimum of the values for the Amt node in the repeating element Items.

    number

    round-fraction

    round-fraction( a number , num digits )

    tib

    Returns the closest double with as many fraction digits as specified, rounding up if there are two integers equally close to the number.
    Note that this still returns a double, not an arbitrary precision number, so there can still be precision issues.

    round-fraction(5.53001,2) = 5.53
    round-fraction(5.555,2) = 5.56
    round-fraction(-1.505E3,1) = -1.5

    number

    string-round-fraction

    string-round-fraction( a number , num digits )

    tib

    Returns the string representation of the number with as many fraction digits as specified, rounding up if there are two integers equally close to the number.
    This can be used for simple number formatting to ensure the correct number of fraction digits for a number.

    string-round-fraction(5.53001,2) = 5.53
    string-round-fraction(5,2) = 5.00

    qname

    expanded-qname

    expanded-QName(URI-string, localName-string)

    1.0

    (deprecated, no longer part of spec) Returns an xs:QName with the given namespace URI and localName

    expanded-QName("http://www.example.com/example", "person")) = QName with namespace URI = "http://www.example.com/example" and local name = "person"

    qname

    qname

    QName(namespaceURI-string, QName-string)

    2.0

    Returns an xs:QName with the given namespace URI, and a local name and prefix from the QName string.

    QName("http://www.example.com/example", "ht:person") = QName with namespace URI = "http://www.example.com/example", local name = "person" and prefix = "ht"

    qname

    resolve-qname

    resolve-QName( qname , element )

    2.0

    Returns an xs:QName value (that is, an expanded-QName) by taking an xs:string that has the lexical form of an xs:QName (a string in the form "prefix:local-name" or "local-name") and resolving it using the in-scope namespaces for a given element.

    resolve-QName("ns1:hello", $element) = QName with local name "hello" that is in the namespace referenced by the "ns1" prefix, if $element has that namespace in scope

    qname

    namespace-uri-from-qname

    namespace-uri-from-QName(QName)

    2.0

    Returns the namespace URI for the given QName as an string

    namespace-uri-from-QName(fn:QName("http://www.example.com/example", "person")) = "http://www.example.com/example"<
    >

    qname

    local-name-from-qname

    local-name-from-QName(QName)

    2.0

    Returns the local part of the given QName as an NCName

    local-name-from-QName(fn:QName("http://www.example.com/example", "person")) = "person"

    set

    position

    position()

    1.0

    Returns the position of the current element. You can use the position number as a shortcut for referencing a specific element in a repeating item instead of using the position() function.

    $Items[position] = The position of the current element in the $Items repeating element.
    $Items[position()>1] = All elements of $Items after the first element.

    set

    current

    current()

    1.0

    Returns the node from the closest for-each. This differs from '.' in that it is unchanged inside of a predicate ([]).

    current()
    node[current()/key=akey]

    set

    id

    id( object )

    1.0

    Returns the nodes by their unique ID. Consult documentation or specification for more details.

    id($Order/Items/Amt)

    set

    local-name

    local-name( node-set? )

    1.0

    Returns the local name of the first node in the node-set. If node-set is omitted, it uses the context node

    local-name(myValue)="Auto"

    set

    name

    name( node-set? )

    1.0

    Returns the qualified name of the first node in the node-set. If node-set is omitted, it uses the context node

    local-name(myValue)="xyz:Auto"

    set

    count

    count( node-set )

    1.0

    Returns the number of child elements in the specified node-set.

    count($Order/Items) = 5

    set

    last

    last()

    1.0

    Returns the number of child elements in the current element. This is useful for returning the last item in a list.

    $Items[last()] = The last element of $Items.
    $Order/Items[last()-1] = The second to last item in the $Order/Items repeating element.

    set

    namespace-uri

    namespace-uri( node-set? )

    1.0

    Returns the namespace of the first node in the node-set. If node-set is omitted, it uses the context node

    starts-with(namespace-uri(myValue),"http://www.w3.org")<
    >

    set

    empty

    empty( node-set )

    2.0

    Returns true if the node set has no elements.
    This is equivalent to count($set)=0

    empty($Item/middleName) = true

    set

    exists

    exists( node-set )

    2.0

    Returns true if the node set is not empty.
    This is equivalent to count($set)>0

    exists($Item/middleName) = false

    set

    if-absent

    if-absent( node , default-value )

    tib

    If the passed in node-set has at least one element, returns that, if it is empty, it returns the second argument

    if-absent("$Item/middleName,'Rufus') = Rufus if there is no middle name, otherwise the middle name

    string

    starts-with

    starts-with( string , test-string )

    1.0

    Returns true if the first parameter string starts with the second parameter string, and otherwise returns false.

    starts-with($Cust/FirstName,"Chris") = true if the value of the node FirstName starts with the string "Chris", otherwise, returns false.

    string

    string-length

    string-length( string )

    1.0

    Returns the number of characters in the string.

    string-length("Ohio") = 4

    string

    contains

    contains( string , test-string )

    1.0

    Returns true if the first parameter string contains the second parameter string, and otherwise returns false.

    contains($Order/Date,"1999") = true if the node Date contains the string 1999, otherwise returns false.

    string

    translate

    translate( source , fromCharList , toCharList )

    1.0

    Returns the first parameter string with occurrences of characters in the second parameter string replaced by the character at the corresponding position in the third parameter string.

    translate("bar", "abc", "ABC") = BAr

    string

    normalize-space

    normalize-space( string )

    1.0

    Returns the parameter string with white space normalized by stripping leading and trailing whitespace and replacing sequences of whitespace characters by a single space.

    normalize-space(" Name Address ") = Name Address

    string

    substring-before

    substring-before( string , end-string )

    1.0

    Returns the substring of the first parameter string that precedes the first occurrence of the second parameter string in the first parameter string, or the empty string if the first parameter string does not contain the second parameter string.

    substring-before("1999/04/01","/") = 1999

    string

    substring-after

    substring-after( string , starting-string )

    1.0

    Returns the substring of the first parameter string that follows the first occurrence of the second parameter string in the first parameter string, or the empty string if the first parameter string does not contain the second parameter string.

    substring-after("199/04/01","/") = 04/01

    string

    string

    string( object )

    1.0

    Converts the parameter to a string.

    string(1234) = "1234"

    string

    substring

    substring( string , from-index , opt. length )

    1.0

    Returns the substring of the first parameter starting at the position specified in the second parameter with length specified in the third parameter. The second parameter is an index that starts at 1.

    substring("12345",2,3) = 234

    string

    concat

    concat( string1 , string2,... )

    1.0

    Returns the concatenation of the function parameters. You can concatenate two or more strings.

    concat($Cust/firstName, ' ', $Cust/lastName) = John Smith

    string

    upper-case

    upper-case( aString )

    2.0

    Returns a new string where all the lower-case characters have been converted to upper-case. All other characters are unchanged.

    upper-case("aBc123") = ABC123

    string

    lower-case

    lower-case( aString )

    2.0

    Returns a new string where all the upper-case characters have been converted to lower-case. All other characters are unchanged.

    lower-case("aBc123") = abc123

    string

    index-of

    index-of( string , test-string )

    tib

    Returns the 1-based index of the first occurrence of test-string in the first string. Returns -1 if there is no match.

    index-of("alpha alpha","lpha") = 2
    index-of("alpha alpha","beta") = -1

    string

    left

    left( string , numCharacters )

    tib

    Returns a string containing the first numCharacters characters of the first string.
    If numCharacters is less than or equals to zero, it returns an empty string.
    If the number of characters is greater than the string length, it returns the entire string.

    left("12345",3) = 123

    string

    pad-and-limit

    pad-and-limit( string , pad-to-length , optional pad-character )

    tib

    Returns a string padded to the indicated length with the pad character. If not specified, space is used as the pad character. If the given string is longer than the indicated length, it returns an error.

    pad-and-limit('Hello','7','X') = HelloXX
    pad-and-limit('Hello','3') = (An error)

    string

    pad

    pad( string , pad-to-length , optional pad-character )

    tib

    Returns a string padded to the indicated length with the pad character. If not specified, space is used as the pad character. If the given string is longer than the indicated length, the string is returned unchanged.

    pad('Hello','7','X') = HelloXX
    pad('Hello','3') = Hello

    string

    tokenize

    tokenize( string , optionalDelimeterString )

    tib

    Breaks an input string into tokens, returning a sequence of string tokens in order.
    The second argument contains the delimeter characters. If not specified, the delimeters are space, new-line, carriage-return and tab.
    A token must be at least 1 character long, so empty fields are skipped; see the tokenize-allow-empty function for an alternative.

    count(tokenize("alpha beta gamma")) = 3
    concat("xyz",tokenize("alpha, beta, gamma",",")[2],"eol") = xyz betaeol
    count("alpha,,,gamma",",") = 2

    string

    pad-front

    pad-front( string , pad-to-length , optional pad-character )

    tib

    Returns a string front-padded to the indicated length with the pad character. If not specified, space is used as the pad character. If the given string is longer than the indicated length, the string is returned unchanged.

    pad-front('Hello','7','Z') = ZZHello
    pad-front('Hello','3') = Hello

    string

    concat-sequence-format

    concat-sequence-format( node-set , separator , optional excludeEmpty )

    tib

    Concatenates the string value of each node in order, using a string separator between entries. If excludeEmpty is true, empty strings are not included. If omitted, false is assumed.
    Note that more than one node must be selected for any formatting to take place; selected a 'root' node will not format the children automatically.

    concat-sequence-format($Album/artists/lastName,', ') = Lennon, McCartney, Harrison, Starr
    concat-sequence-format($Album/artists/optionalMiddleInitial,', ', true()) = C, J
    concat-sequence-format($Album/artists,', ') = JohnLennon, PaulMcCartney, GeorgeCHarrison, RingoJStarr
    concat-sequence-format($Album/artists/*,', ') = John, Lennon, Paul, McCartney, George, C, Harrison, Ringo, J, Starr

    string

    right

    right( string , numCharacters )

    tib

    Returns a string containing the last numCharacters characters of the string.
    If numCharacters is less than or equals to zero, returns the empty string.
    If numCharacters is greater than the length of the string, it returns the entire string.

    right("12345",3) = 345

    string

    substring-after-last

    substring-after-last( string , marker-string )

    tib

    Returns the substring of the first parameter string that follows the last occurrence of the second parameter string in the first parameter string, or the empty string if the first parameter string does not contain the second parameter string.

    substring-after-last("199/04/01","/") = 01

    string

    render-xml

    render-xml( element or document , optional omit-header , optional pretty-pretty )

    tib

    Formats the element or document as an xml string.
    The optional second argument is omit-header, which defaults to false.
    The optional third argument is 'pretty-print', which also defaults to false.

     

    string

    trim

    trim( string )

    tib

    Returns the parameter string with leading and trailing white space removed. Whitespace consists of spaces, tabs, new-lines, and carriage returns.
    Unlike normalize-space, whitespace not leading or trailing is unaffected.

    trim(" Name Address ") = Name Address

    string

    tokenize-allow-empty

    tokenize-allow-empty( string , optionalDelimeterString )

    tib

    Breaks an input string into tokens, returning a sequence of string tokens in order.
    The second argument contains the delimeter characters, if not specified the delimeters are space, new-line, carriage-return and tab.
    Unlike the tokenize function, zero length strings are included.

    count(tokenize-allow-empty("alpha,,beta")) = 3

    string

    concat-sequence

    concat-sequence( node-set )

    tib

    Concatenates the string value of each node in order.

    concat-sequence($Album/artists/firstName) = JohnPaulGeorgeRingo
    concat-sequence($Album/artists/lastName) = LennonMcCartneyHarrisonStarr

    string

    last-index-of

    last-index-of( string , test-string )

    tib

    Returns the 1-based index of the last occurrence of test-string in the first string. Returns -1 if there is no match.

    last-index-of("alpha alpha","lpha") = 8
    last-index-of("alpha alpha","beta") = -1

    string

    substring-before-last

    substring-before-last( string , marker-string )

    tib

    Returns the substring of the first parameter string that precedes the last occurrence of the second parameter string in the first parameter string, or the empty string if the first parameter string does not contain the second parameter string.

    substring-before-last("1999/04/01","/") = 1999/04

     

    timezone-from-date

      

    Runtime only

     
     

    seconds-from-duration

      

    Runtime only

     
     

    string-to-codepoints

      

    Runtime only

     
     

    month-from-date

      

    Runtime only

     
     

    adjust-date-to-timezone

      

    Runtime only

     
     

    hours-from-duration

      

    Runtime only

     
     

    subtract-dateTimes-yielding-dayTimeDuration

      

    Runtime only

     
     

    day-from-date

      

    Runtime only

     
     

    escape-uri

      

    Runtime only

     
     

    get-days-from-dayTimeDuration

      

    Runtime only

     
     

    day-from-dateTime

      

    Runtime only

     
     

    current-grouping-key

      

    Runtime only

     
     

    days-from-duration

      

    Runtime only

     
     

    data

      

    Runtime only

     
     

    year-from-date

      

    Runtime only

     
     

    current-time

      

    Runtime only

     
     

    implicit-timezone

      

    Runtime only

     
     

    timezone-from-dateTime

      

    Runtime only

     
     

    not3

      

    Runtime only

     
     

    timezone-from-time

      

    Runtime only

     
     

    codepoints-to-string

      

    Runtime only

     
     

    doc

      

    Runtime only

     
     

    years-from-duration

      

    Runtime only

     
     

    unparsed-entity-uri

      

    Runtime only

     
     

    minutes-from-dateTime

      

    Runtime only

     
     

    remove

      

    Runtime only

     
     

    document

      

    Runtime only

     
     

    doc-available

      

    Runtime only

     
     

    context-item

      

    Runtime only

     
     

    minutes-from-time

      

    Runtime only

     
     

    adjust-dateTime-to-timezone

      

    Runtime only

     
     

    get-minutes-from-dayTimeDuration

      

    Runtime only

     
     

    hours-from-time

      

    Runtime only

     
     

    month-from-dateTime

      

    Runtime only

     
     

    get-namespace-from-QName

      

    Runtime only

     
     

    get-seconds-from-dayTimeDuration

      

    Runtime only

     
     

    seconds-from-dateTime

      

    Runtime only

     
     

    get-years-from-yearMonthDuration

      

    Runtime only

     
     

    adjust-time-to-timezone

      

    Runtime only

     
     

    ends-with

      

    Runtime only

     
     

    empty-sequence

      

    Runtime only

     
     

    get-months-from-yearMonthDuration

      

    Runtime only

     
     

    hours-from-dateTime

      

    Runtime only

     
     

    minutes-from-duration

      

    Runtime only

     
     

    current-group

      

    Runtime only

     
     

    string-pad

      

    Runtime only

     
     

    subtract-dateTimes-yielding-yearMonthDuration

      

    Runtime only

     
     

    string-join

      

    Runtime only

     
     

    function-available

      

    Runtime only

     
     

    element-available

      

    Runtime only

     
     

    months-from-duration

      

    Runtime only

     
     

    format-number

      

    Runtime only

     
     

    get-hours-from-dayTimeDuration

      

    Runtime only

     
     

    system-property

      

    Runtime only

     
     

    seconds-from-time

      

    Runtime only

     
     

    year-from-dateTime

      

    Runtime only

     

    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...