<xsl:variable name="titleparam"> <xsl:choose> <xsl:when test="contains(substring-after($videoinfo, '&title='), '&')"> <xsl:value-of select="substring-before(substring-after($videoinfo, '&title='), '&')"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="substring-after($videoinfo, '&title=')"/> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:value-of select="str:decode-uri(str:replace($titleparam, '+', ' '))"/>