cJo*_*key 0 xslt sitecore multiline
我在项目(多行文本)中有一个字段,我在xslt渲染中输出.问题是我的输出中没有显示carrigae返回 - 我需要做些什么来使我的xslt输出显示carrigae返回?
使用此模板替换换行符:
<xsl:template name="br">
<xsl:param name="text"/>
<xsl:choose>
<xsl:when test="contains($text,'
')">
<xsl:value-of select="substring-before($text,'
')"/>
<br/>
<xsl:call-template name="br">
<xsl:with-param name="text">
<xsl:value-of select="substring-after($text,'
')"/>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$text"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
Run Code Online (Sandbox Code Playgroud)
并将其称为您的文本项,如下所示:
<xsl:call-template name="br">
<xsl:with-param name="text" select="somenode/mytext"/>
</xsl:call-template>
Run Code Online (Sandbox Code Playgroud)