All articles(网络文学目录) All Pictures(图片目录) All Softwares(软件目录)

 
C#根据条件搜索Infopath生成的XML数据_.net资料_编程技术

Writer: aaa Article type: Programming skills(编程技巧) Time: 2013/12/17 7:46:22 Browse times: 356 Comment times: 0

C#根据条件搜索Infopath生成的XML数据_.net资料_编程技术


Head photo

Go homepage
Upload pictures
Write articles

C#根据条件搜索Infopath生成的XML数据_.net资料_编程技术-你的首页-uuhomepage.com

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 = '好






There are 0 records,
Comment:
Must be registered users to comment(必须是注册用户才能发表评论)

Disclaimer Privacy Policy About us Site Map
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.