I have two XSLT variables, as shown below.
& lt; Select xsl: variable name = "staticbase URL" = "'https://www.hello.com/htapi/PrintApp.asmx/getGames?contentId=id_sudoku&uniqueId=" 123456 "and page format = a4'" / " Gt; & Lt; Xsl: variable name = "dynamicUrl" = "'https://www.hello.com/htapi/PrintApp.asmx/getGames'" /> I need to check whether the second string is already a substrate or not. Please help me ....
To check whether a string is included in another , Use the function.
Example: & lt; Xsl: if test = "($ staticBaseUrl, $ dynamicUrl) contains" & gt; & Lt; XSL: Text & gt; Yes & lt; / XSL: text & gt; & Lt; / XSL: If & gt; Update: For case-insensitive, you must first convert the two strings before calling in the same case . In XSLT 2.0, you can use the upper-case function, but in XSLT 1.0 you can use: & Lt; Xsl: variable name = "uppercase" select = "'ABCDEFGHIKLMNAPCRSTUVXX" / / gt; & Lt; Xsl: template match = "/" & gt; & Lt; Xsl: if test = "(included ($ staticBaseUrl, $ lowercase, $ uppercase), translate ($ dynamicUrl, $ smallcase, $ uppercase))" & gt; & Lt; XSL: Text & gt; Yes & lt; / XSL: text & gt; & Lt; / XSL: If & gt; & Lt; / XSL: Templates & gt;
Comments
Post a Comment