Новости | FAQ | Авторы | Документация | В действии | Библиотека |
Инструменты | Полезные ссылки | Хостинги | Скачать | Примеры | Форум |
G_Z 14.02.2006 01:40
Сделал некрасиво, но работает.<xsl:template name="trimTags"> <xsl:param name="string"/> <xsl:choose> <xsl:when test="contains($string, '<') and contains($string, '>')"> <xsl:variable name="tag_before" select="substring-before($string, '<')"/> <xsl:variable name="tag_after" select="substring-after($string, '>')"/> <xsl:variable name="result"> <xsl:value-of select="$tag_before"/> <xsl:value-of select="$tag_after"/> </xsl:variable> <xsl:choose> <xsl:when test="contains($result, '<') and contains($result, '>')"> <xsl:call-template name="trimTags"> <xsl:with-param name="string" select="$result"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:value-of select="$result" disable-output-escaping="yes"/> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <xsl:value-of select="$string" disable-output-escaping="yes"/> </xsl:otherwise> </xsl:choose> </xsl:template>