Moa*_*oak 4 xpath attributes replace
如果
/dt/@id
Run Code Online (Sandbox Code Playgroud)
返回comment_34232或comment_12我怎样才能让它返回34232或12(换句话说,'comment_'替换为''
而如果
/span/style
Run Code Online (Sandbox Code Playgroud)
返回width: 80%;我如何替换 width:,然后%;再取回80
问候
一、部分
如果
Run Code Online (Sandbox Code Playgroud)/dt/@id returns `comment_34232` or `comment_12` how can I make it return
34232或12(换句话说,'comment_'替换为''
使用:
substring-after(/dt/@id, '_')
Run Code Online (Sandbox Code Playgroud)
二、部分
而如果
Run Code Online (Sandbox Code Playgroud)/span/style returns `width: 80%;` how can I replace `width: ` and after那
%;检索80
使用:
substring-before(substring-after(/span/style, ' '), '%')
Run Code Online (Sandbox Code Playgroud)
请注意:使用标准 XPath 函数substring-before()和substring-after().
| 归档时间: |
|
| 查看次数: |
1902 次 |
| 最近记录: |