Xpath matches againt items

2019-08-08 16:21发布

The matches function acts against a string (where the result is a single item of type string). Looking for a way with XPath to do the same regular expression matches but against items (result is a sequence of nodes/items)?

标签: xpath-2.0
1条回答
地球回转人心会变
2楼-- · 2019-08-08 17:14
//foo/bar[matches( ., 'regexp' )]

Is this what you're looking for or am I misunderstanding your question. This filters the //foo/bar nodelist based on the string value of every node. (The string value of elements is the concatenation of all the text nodes within it.)

查看更多
登录 后发表回答