相关疑难解决方法(0)

如何应用XPath函数'substring-after'

什么是XPath表达式,我将用于获取每本书的'HarryPotter:'之后的字符串.

即.鉴于此XML:

<bookstore>
<book>
  HarryPotter:Chamber of Secrets 
</book>
<book>
  HarryPotter:Prisoners in Azkabahn 
</book>
</bookstore>
Run Code Online (Sandbox Code Playgroud)

我会回来的:

Chamber of Secrets
Prisoners in Azkabahn 
Run Code Online (Sandbox Code Playgroud)

我尝试过这样的事情:

/bookstore/book/text()[substring-after(. , 'HarryPotter:')] 
Run Code Online (Sandbox Code Playgroud)

我认为我的语法不正确......

xml xpath

17
推荐指数
2
解决办法
3万
查看次数

标签 统计

xml ×1

xpath ×1