使用XPATH"ends-with"查找变量. [英] Find variables using XPATH "ends-with"

查看:280
本文介绍了使用XPATH"ends-with"查找变量.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试访问具有以"_abc"结尾的属性的XML变量.
我遇到了一个我认为可能有用的Xpath选项.

这是表达式:

I''m trying to access XML variables that have attributes that end with "_abc".
I ran across an Xpath option that I think might work.

Here''s the expression:

SelectNodes("//FieldSpecs/FS//@*[ends-with(name(), \"abc\")]/");



使用它时,出现以下错误:



When I use it, I get the following error:

ex.Message = "Expression must evaluate to a node-set."

推荐答案

该函数end-with()不是为XPath 1.0定义的*而是仅为XPath 2.0和XQuery定义的.因此,请确保您使用的是XPath.
参考LInk:-问题获取xpath函数ends-with() [那里-[XQuery 1.0和XPath 2.0函数和运算符] [ ^ ]
The function ends-with() is not defined for XPath 1.0 *but only for XPath 2.0 and XQuery. so be sure whish XPath you are using.
Reference LInk :-problem getting xpath function ends-with()[^]
for more reference Link! have a look there-[XQuery 1.0 and XPath 2.0 Functions and Operators][^]


这篇关于使用XPATH"ends-with"查找变量.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆