How do I write Xpath statement to find Class="ER" AND Description Contains "NEW"?
I've tried the following and get "Namespace Manager or Xslt Context needed" Error - What do I need to make this work??
If I run just XmlDataSource1.Xpath="/Inventory_List/Inventory[@Class='ER'] then that part works correctly - just can't get past error with 'Contains' function either by itself or with the AND operator.
XmlDataSource1.Xpath="/Inventory_List/Inventory[@Class='ER'] and /Inventory_List/Inventory[contains (@Description ,'New')]"
Accroding to your description,I suggest you could put multiple attributes in the same [].Beside,you could use contains().
More details,you could refer to below codes:
XmlDataSource1.XPath="/Inventory_List/Inventory[@Class='ER' and contains(@Description,'New')]"
Best regards,
Yijing Sun
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Accroding to your description,since you haven't post your codes,as far as I think,you could pass namespacemanager as a parameter to the selectNodes method.
I suggest you could post your current code to us.It will help us solve your problem.
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Member
41 Points
234 Posts
How to use XPATH with XML Data Source
Mar 02, 2020 06:11 AM|TRIMS30|LINK
Have XML Data as shown Below:
How do I write Xpath statement to find Class="ER" AND Description Contains "NEW"?
I've tried the following and get "Namespace Manager or Xslt Context needed" Error - What do I need to make this work??
If I run just XmlDataSource1.Xpath="/Inventory_List/Inventory[@Class='ER'] then that part works correctly - just can't get past error with 'Contains' function either by itself or with the AND operator.
Could use some help on this !
Thanks.
LB
Contributor
3740 Points
1435 Posts
Re: How to use XPATH with XML Data Source
Mar 03, 2020 06:08 AM|yij sun|LINK
Hi TRIMS30,
Accroding to your description,I suggest you could put multiple attributes in the same [].Beside,you could use contains().
More details,you could refer to below codes:
Best regards,
Yijing Sun
Member
41 Points
234 Posts
Re: How to use XPATH with XML Data Source
Mar 03, 2020 02:22 PM|TRIMS30|LINK
Thanks - tried that but still get error "Namespace Manager or XsltContext needed"
What extra code do I need?
Lee
Contributor
3740 Points
1435 Posts
Re: How to use XPATH with XML Data Source
Mar 04, 2020 08:48 AM|yij sun|LINK
Hi TRIMS30,
Accroding to your description,since you haven't post your codes,as far as I think,you could pass namespacemanager as a parameter to the selectNodes method.
I suggest you could post your current code to us.It will help us solve your problem.
More details, you could refer to below article:
https://forums.asp.net/t/1744543.aspx?Namespace+Manager+or+XsltContext+needed+This+query+has+a+prefix+variable+or+user+defined+function+
Best regards,
Yijing Sun
Member
41 Points
234 Posts
Re: How to use XPATH with XML Data Source
Mar 04, 2020 08:02 PM|TRIMS30|LINK
Problem fixed - had some JavaScript attached to DropDownList that was bound to my XLS table.
Removed that Script and al is working now.
Thanks,
Lee