开发者

I need a way to implement the function matches() from XPath 2.0 with functions from XPath 1.0

开发者 https://www.devze.com 2023-01-03 15:30 出处:网络
I have the following piece of code: root=\"//valueExpression[matches(self::*,\'p开发者_开发技巧attern\')]/..\"

I have the following piece of code:

root="//valueExpression[matches(self::*,'p开发者_开发技巧attern')]/.."

But I can only use XPath 1.0 and I get an exception for the function matches(). Can you please help me with a solution using only functions from XPath 1.0 ?


Generally, this can't be done just using XPath 1.0.

However, there is a set of standard XPath 1.0 functions that you can use for string processing:

  • substring()
  • substring-before()
  • substring-after()
  • translate()
  • normalize-space()
  • string-length()
  • count()
0

精彩评论

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