国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > XML > 正文

C#根據條件搜索Infopath生成的XML數據

2024-09-05 20:55:59
字體:
來源:轉載
供稿:網友

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

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 富源县| 图木舒克市| 蓬安县| 平顺县| 峡江县| 通化县| 弥勒县| 上思县| 镇安县| 新宁县| 栾川县| 深泽县| 延川县| 安顺市| 屏东市| 开阳县| 万年县| 宁陵县| 牙克石市| 台东县| 哈尔滨市| 晴隆县| 巩留县| 烟台市| 灵山县| 商洛市| 四平市| 永定县| 田阳县| 安化县| 婺源县| 兰州市| 龙口市| 文化| 石狮市| 益阳市| 喜德县| 隆昌县| 南华县| 湖南省| 海阳市|