Click here to Skip to main content
15,889,429 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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:

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


When I use it, I get the following error:

C#
ex.Message = "Expression must evaluate to a node-set."
Posted
Updated 10-Dec-11 5:00am
v2
Comments
[no name] 10-Dec-11 11:01am    
EDIT: added "pre" tags

1 solution

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][^]
 
Share this answer
 
v2
Comments
Abhinav S 10-Dec-11 9:30am    
Nice. 5.
Wonde Tadesse 11-Dec-11 17:04pm    
5+.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900