I have two XSLT variables as given below:
<xsl:variable name="staticBaseUrl" select="'https://www.hello.com/htapi/PrintApp.asmx/getGames?contentId=id_sudoku&uniqueId="123456"&pageformat=a4'" />
<xsl:variable name="dynamicUrl" select="'https://www.hello.com/htapi/PrintApp.asmx/getGames'" />
How to check whether the second string (dynamicUrl) is a substring of the first string (staticBaseUrl) or not?
To check if one string is contained in another, use the
contains
function.Example:
Update:
For case-insensitive contains, you need to first convert the two strings to the same case before calling
contains
. In XSLT 2.0 you can use theupper-case
function, but in XSLT 1.0 you can use the following: