Last post Mar 04, 2020 08:02 PM by TRIMS30
Mar 02, 2020 06:11 AM|TRIMS30|LINK
Have XML Data as shown Below:
<Inventory Stock_No="A-1-1" Description="Something" Class="ER" />
<Inventory Stock_No="A-1-2" Description="Something New" Class="ER" />
<Inventory Stock_No="B-1-2" Description="Someone New" Class="PQ" />
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')]"
Could use some help on this !
Mar 03, 2020 06:08 AM|yij sun|LINK
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')]"
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?
Mar 04, 2020 08:48 AM|yij sun|LINK
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:
Mar 04, 2020 08:02 PM|TRIMS30|LINK
Removed that Script and al is working now.