gpt4 book ai didi

xslt - 带子字符串的 xsl 副本

转载 作者:行者123 更新时间:2023-12-02 02:16:46 27 4
gpt4 key购买 nike

我从这个 post 得到的 xsl 中有这个函数

用“换行符”替换“cr”

我是这样调用它的:

<xsl:variable name="breakText">
<xsl:call-template name="insertBreaks">
<xsl:with-param name="subject" select="PublicProfile/AboutMe"/>
</xsl:call-template>
</xsl:variable>

我正在做文章链接,点击文本“阅读更多”文章短开头的第一个 div(长文章的 550 个字符)像我没有使用“insertBreaks”函数一样显示文本

<xsl:copy-of select="substring($breakText,0,550)"/>

但是长描述的这一行工作正常:

<xsl:copy-of select="$breakText"/>

我哪里错了?

最佳答案

您想使用 xsl:value-of 而不是 xsl:copy-ofxsl:copy-of 返回所选标签的元素及其所有值。 xsl:value-of 返回与所选标签关联的文本。由于您正在尝试获取子字符串,因此您需要文本。

关于xslt - 带子字符串的 xsl 副本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10171924/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com