gpt4 book ai didi

xslt - 在 XPath/XSL 中获取子/孙子的全文

转载 作者:行者123 更新时间:2023-12-03 16:00:42 25 4
gpt4 key购买 nike

我正在使用 XSL 1.0 样式表,并且我有一个类似于以下内容的节点:

<p>Hello, <b>John</b>, how are you?</p>

我目前在与 <p> 匹配的 xsl:template 中节点。我想创建一个以字符串值“Hello, John, how are you?”结尾的 xsl:variable。

text()函数在这里失败,因为它只返回“你好,你好吗?”。

最佳答案

只取当前节点的字符串值可能效率更高

 <xsl:variable name="x">
<xsl:value-of select="."/>
<xsl:variable>

关于xslt - 在 XPath/XSL 中获取子/孙子的全文,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9708988/

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