从XPath字符串中删除或替换一些文本

Sim*_*mon 3 xpath

是否可以删除或替换XPath字符串上的文本?

使用XPath,我获得的URL是http:// www,并且我想删除http:// www,因此相同的XPath查询将仅向我返回一个没有http:// www的链接。我找不到有关删除或替换Xpath字符串的任何信息。

可能吗?如果是这样,该怎么做?

acd*_*ior 5

你试过了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)

在此处查看在线演示