Infopath生成的XML文件如下
    
    
        
             1
             书
             好
        
        
             2
             书      
             
        
         
             3
             书
             好
        
        
             4
             4
             4         
         
我想取得所有 c2 = '书' 的 c1的值,网上搜了好半天都没有类似的例子,只好自己根据Infopath模板中的XSL中的Xpath来琢磨
如下是可行的方法:
IXMLDOMNodeList nodelist = thisXDocument.DOM.SelectNodes("//Table1/b/c/c1[../c2 = '书']");
或者
IXMLDOMNodeList nodelist = thisXDocument.DOM.SelectNodes("//Table1/b/c/c1[../c2 = \"书\"]");
如果想取得 c2 ='书' 并且 c3 = '好'的c1值:
IXMLDOMNodeList nodelist = thisXDocument.DOM.SelectNodes("//Table1/b/c/c1[../c2 = '书' and ../c3 = '好']");
或者
IXMLDOMNodeList nodelist = thisXDocument.DOM.SelectNodes("//Table1/b/c/c1[../c2 = \"书\" and ../c3 = '好