开发者

Xpath matches againt items

开发者 https://www.devze.com 2023-02-14 03:47 出处:网络
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 (r开发者_如何学Ce

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 (r开发者_如何学Cesult is a sequence of nodes/items)?


//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.)

0

精彩评论

暂无评论...
验证码 换一张
取 消