Background – Visual Studio 2010, C#, .Net Framework 4.0 application
I have a web site that receives XML and based off that XML, I need to trigger additional processing to occur.
I receive the following XML (I have shortened it down to a minimal XML)
<Event xmlns="http://www.mysite.com" et='a'>
<audit>
<cb>foo</cb>
</audit>
</Event>
I have been using the following XPath to see if the document matches for additional processing.. (checking to see if I get any “Event” nodes back).
//std:Event[@et='a']
Where I have struggled is that I need to find all Event nodes where the et attribute is “a” and the audit/cb node had a value of ‘foo’
This is where I am struggling… Can anyone help me out?
Not sure of the C# and .NET but in pure XPath syntax I believe it would be:
Check out Xpath syntax at: http://www.w3schools.com/XPath/xpath_syntax.asp