xml| Data | conditions
InfoPath-generated XML files are as follows
<Table1>
<a></a>
<b></b>
<c>
<c1>1</c1>
<c2> Book </c2>
<c3> Good </c3>
</c>
<c>
<c1>2</c1>
<c2> Book </c2>
<c3></c3>
</c>
<c>
<c1>3</c1>
<c2> Book </c2>
<c3> Good </c3>
</c>
<c>
<c1>4</c1>
<c2>4</c2>
<c3>4</c3>
</c>
</Table1>
I want to get all the C2 = ' book ' of the value of the C1, online search for a while no similar example, had to be based on the InfoPath template in the XSL XPath to ponder
The following are feasible methods:
IXMLDOMNodeList nodelist = ThisXDocument.DOM.SelectNodes ("//table1/b/c/c1[. /C2 = ' book '] ");
Or
IXMLDOMNodeList nodelist = ThisXDocument.DOM.SelectNodes ("//table1/b/c/c1[. /C2 = \ "book \"]);
If you want to get C2 = ' book ' and C3 = ' good ' C1 value:
IXMLDOMNodeList nodelist = ThisXDocument.DOM.SelectNodes ("//table1/b/c/c1[. /C2 = ' book ' and. /C3 = ' good '] ");
Or
IXMLDOMNodeList nodelist = ThisXDocument.DOM.SelectNodes ("//table1/b/c/c1[. /C2 = \ "book \" and. /C3 = ' good