substring-before($source as xs:string?, $search as xs:string?) xs:string?
Returns the substring of the value of $source that precedes the first occurrence of a sequence of the value of $search. If the value of $source or $search is the empty sequence it is interpreted as the zero-length string. If the value of $search is the zero-length string, the zero-length string is returned. If the value of $source does not contain a string that is equal to the value of $search, the zero-length string is returned.
substring-before($source as xs:string?, $search as xs:string?, $collation-uri as xs:string) xs:string?
Returns the substring of the value of $source that precedes the first occurrence of a sequence of the value of $search in the collation $collation-uri. If the value of $source or $search is the empty sequence it is interpreted as the zero-length string. If the value of $search is the zero-length string, the zero-length string is returned. If the value of $source does not contain a string that is equal to the value of $search, the zero-length string is returned. The third argument $collation-uri is relative so you only need to specify the last part of a valid full collation-uri, e.g. '?lang=sv-SE', 'lang=sv-SE;strength=primary;decomposition=standard' or 'swedish'.