gpt4 book ai didi

xslt - XSL之类的还是模糊搜索?

转载 作者:行者123 更新时间:2023-12-02 05:39:59 25 4
gpt4 key购买 nike

是否存在类似于SQL模糊搜索的XSL?

例如:

<xsl:for-each select="foo[foo_type like '%1%']">

最佳答案

使用(在 select 属性中)标准 XPath 函数 contains()如以下 XPath 表达式:

foo[contains(foo_type, '1')]

根据具体情况,下面列出的其他标准 XPath 函数也可能有用:

请注意 ends-with()matches()tokenize()replace() 仅在 XPath 2.0 中可用

可以使用以下 XPath 1.0 表达式来实现与 XPath 2.0 函数 ends-with() 相同的目的:

  substring($s, string-length($s) - string-length($target) +1)
=
$target

相当于:

ends-with($s, $target)

关于xslt - XSL之类的还是模糊搜索?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7167721/

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