The XML schema string-manipulator-datatypes-1.2.xsd defines string manipulation functions that can be used in SIS expressions. Functions that return a Boolean value may also be used as expression conditions in their own right.

The following tables list the string manipulation functions available in the SIS, what they do, and the results they return.

string-prepend

Description

Adds a string prefix to beginning of a string value.

Returns

  • the prefixed value

  • no value, if either parameter cannot be evaluated to a string value

Example

<assign toVariable="user.international-b-party-number">
    <string-prepend source="${user.b-party-number}" prefix="044"/>
</assign>

string-append

Description

Adds a string suffix to the end of a string value.

Returns

  • the suffixed value

  • no value, if either parameter cannot be evaluated to a string value

Example

<assign toVariable="user.foo">
    <string-append source="${user.foo}" suffix="bar"/>
</assign>

string-substring

Description

Extracts a substring from a string value. The begin index specifies the index of the first character to be included. The end index is optional and specifies the index after the last character to be included. If the end index is not specified, it defaults to the length of the source string value.

Returns

  • the specified substring

  • no value, if either index cannot be evaluated to an integer value, is out of bounds of the string length, or the begin index is greater than the end index

Example

<assign toVariable="user.normalised-b-party">
    <string-substring
        source="${initial-dp.arg.called-party-number.address}"
        begin-index="2"/>
</assign>

string-length

Description

Returns the length of a string value.

Returns

  • the string length

  • no value, if the parameter cannot be evaluated to a string value

Example

<assign toVariable="user.from-length">
    <string-length source="${from.uri.user}"/>
</assign>

string-contains

Description

Determines if a string value contains the given substring.

Returns

  • true if the substring exists within the source value

  • false if either parameter cannot be evaluated to a string value

Example

<if>
    <string-contains source="${user.foo}" substring="${user.bar}"/>
    <then> ... </then>
</if>

string-index-of

Description

Returns the index within a string value of the first occurrence of the given substring. The begin index is optional and specifies the index of the first character from where to start the search. If the begin index is not specified, it defaults to 0.

Returns

  • the index within the source value (starting from the given index) of the first occurrence of the substring

  • -1 if the substring does not occur

  • no value, if either the source or substring parameter cannot be evaluated to a string value, or the begin index cannot be evaluated to an integer value

Example

<assign toVariable="user.from-host-index">
    <string-index-of source="${from.uri}" substring="@"/>
</assign>

string-last-index-of

Description

Returns the index within a string value of the last occurrence of the given substring. The begin index is optional and specifies the index of the first character from where to start the search. If the begin index is not specified, it defaults to 0.

Returns

  • the index within the source value (starting from the given index) of the last occurrence of the substring

  • -1 if the substring does not occur

  • no value, if either the source or substring parameter cannot be evaluated to a string value, or the begin index cannot be evaluated to an integer value

Example

<assign toVariable="user.from-root-domain">
    <string-last-index-of source="${from.uri.host}" substring="."/>
</assign>

string-starts-with

Description

Determines if a string value begins with a given prefix. The begin index is optional and specifies the index of the first character from where to start comparing from. If the begin index is not specified, it defaults to 0.

Returns

  • true if the source value (from the given index) starts with the substring

  • false if either the source or substring parameter cannot be evaluated to a string value, or the begin index cannot be evaluated to an integer value

Example

<if>
    <string-starts-with
        source="${initial-dp.arg.calling-party-number.address}"
        substring="00"/>
    <then> ... </then>
</if>

string-ends-with

Description

Determines if a string value ends with a given suffix.

Returns

  • true if the substring is a suffix of the source value

  • false if either parameter cannot be evaluated to a string value

Example

<if>
    <string-ends-with
        source="${from.uri.host}"
        suffix=".net"/>
    <then> ... </then>
</if>

string-matches

Description

Determines if a string value matches a given regular expression.

Returns

  • true if the source value matches the regular expression

  • false if either parameter cannot be evaluated to a string value

Example

<if>
    <not>
        <string-matches
            source="${to.uri}"
            regex="(bxref:[tt[sS][iI][pP][sS]?][eE][lL]):.+"/>
    </not>
    <then> ... </then>
</if>
Previous page Next page