How to get some particular values of attribute in XElement
Clash Royale CLAN TAG#URR8PPP
How to get some particular values of attribute in XElement
I have an xml which contains below code
<row index="2" i1="input.value>5" i2="4" o1="5" />
attribute i1
is an expression: input.value>5
i1
input.value>5
I have a requirement if user enters anything greater than 5 then it should match the xml and return true.
XElement oDataRowNode = _oDecisionTableDOM.XPathSelectElement(xPath);
above code giving me exact matches. Can anyone help me out on figuring out this expression checking in asp.net c#
are you asking for an xpath or any other solution would be okay? what have you tried?
– derloopkat
Aug 6 at 7:26
@jdweng Yes i can give Decoding but how can i compare expressions , i1=6 if i give it should match with Xelement..
– Megha
Aug 6 at 7:31
@derloopkat anything is fine. I need that condition to be matched. bool exists = _oDecisionTableDOM.Elements("data") .Elements("row") .Where(x => x.Value.Contains("input.value")) .Any(); I tried with Linq.. still not getting exact logic to figure this out.
– Megha
Aug 6 at 7:36
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
The jxml was html encoded so you need to use System.Net.WebUtility.HtmlDecode(string)
– jdweng
Aug 6 at 7:20