是否可以删除或替换XPath字符串上的文本?
使用XPath,我获得的URL是http:// www,并且我想删除http:// www,因此相同的XPath查询将仅向我返回一个没有http:// www的链接。我找不到有关删除或替换Xpath字符串的任何信息。
可能吗?如果是这样,该怎么做?
你试过了substring-after吗?
substring-after('http://www.stackoverflow.com', 'http://www.')
Run Code Online (Sandbox Code Playgroud)
例:
<demo>http://www.stackoverflow.com</demo>
Run Code Online (Sandbox Code Playgroud)
XPath:
//demo/substring-after(., 'http://www.')
Run Code Online (Sandbox Code Playgroud)
产量:
stackoverflow.com
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5697 次 |
| 最近记录: |