0
我想运行此XSL:带HTML和截断
<!-- This will remove the tag -->
<xsl:template name="remove-html">
<xsl:param name="text"/>
<xsl:choose>
<xsl:when test="contains($text, '<')">
<xsl:value-of select="normalize-space(substring-before($text, '<'))"/>
<xsl:text> </xsl:text>
<xsl:call-template name="remove-html">
<xsl:with-param name="text" select="normalize-space(substring-after($text, '>'))"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="normalize-space($text)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
这
<xsl:choose>
<xsl:when test="string-length(header) > 22">
<xsl:value-of select="substring(header, 0, 22)" />
<xsl:text>…</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="header" />
</xsl:otherwise>
</xsl:choose>
在一起..我该怎么办呢?
你的意思是你想要的代码的顶部位匹配对'body'元素和对'head'元素底位替换
???
? –不,我想运行一个文本通过,并删除HTML并截断结果 –
我不评论你的方法是否正确,但这两个动作的纯粹组成可以自然地实现捕获变量中第一个动作的输出并将第二个动作应用于该变量。 –