infopath生成的xml文件如下
<table1>
<a></a>
<b></b>
<c>
<c1>1</c1>
<c2>書</c2>
<c3>好</c3>
</c>
<c>
<c1>2</c1>
<c2>書</c2>
<c3></c3>
</c>
<c>
<c1>3</c1>
<c2>書</c2>
<c3>好</c3>
</c>
<c>
<c1>4</c1>
<c2>4</c2>
<c3>4</c3>
</c>
</table1>
我想取得所有 c2 = '書' 的 c1的值,網上搜了好半天都沒有類似的例子,只好自己根據infopath模板中的xsl中的xpath來琢磨
如下是可行的方法:
ixmldomnodelist nodelist = thisxdocument.dom.selectnodes("http://table1/b/c/c1[../c2 = '書']");
或者
ixmldomnodelist nodelist = thisxdocument.dom.selectnodes("http://table1/b/c/c1[../c2 = /"書/"]");
如果想取得 c2 ='書' 并且 c3 = '好'的c1值:
ixmldomnodelist nodelist = thisxdocument.dom.selectnodes("http://table1/b/c/c1[../c2 = '書' and ../c3 = '好']");
或者
ixmldomnodelist nodelist = thisxdocument.dom.selectnodes("http://table1/b/c/c1[../c2 = /"書/" and ../c3 = '好
新聞熱點
疑難解答