To check if one line is contained in another, use the contains function.
Example:
<xsl:if test="contains($staticBaseUrl,$dynamicUrl)"> <xsl:text>Yes!</xsl:text> </xsl:if>
Update:
For case insensitivity, you must first convert two strings to the same register before calling contains . In XSLT 2.0 you can use the upper-case function, but in XSLT 1.0 you can use the following:
<xsl:variable name="smallcase" select="'abcdefghijklmnopqrstuvwxyz'" /> <xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" /> <xsl:template match="/"> <xsl:if test="contains(translate($staticBaseUrl,$smallcase,$uppercase), translate($dynamicUrl,$smallcase,$uppercase))"> <xsl:text>Yes!</xsl:text> </xsl:if> </xsl:template>
source share