Tell me, there is a string "XXQWERTY". How can I display a string without "XX", if these characters are at the beginning? "XXQWERTY" = "QWERTY" "YZQWERTY" = "YZQWERTY"
1 answer
<xsl:choose> <xsl:when test="starts-with(., 'XX')"> <xsl:value-of select="substring(., 3)"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="."/> </xsl:otherwise> </xsl:choose>
The starts-with
function determines whether a value begins with certain characters. If yes, the function substring
gets the value from the specified position. If not, take the value entirely.
|