XPath starts-with

Last modified: March 9, 2026

Overview

The starts-with() function tests whether a string attribute starts with a specific string as a sub-string.

Syntax

The syntax is as follows:

starts-with ( attribute, string_expression )

attribute

attribute specifies the attribute to test. It must be of the String type.

expression

string_expression specifies the value to test for being at the start of the attribute. It should be a string literal or a string parameter.

Example

This query returns all the customers from which the name starts with the string "Jans":

        [starts-with(Name, 'Jans')]
    
        //Sales.Customer[starts-with(Name, 'Jans')]
    

Customers with the name "Jansen" will be returned, for example, because the name starts with "Jans."