zoukankan      html  css  js  c++  java
  • 两个常用的Infopath Service读取域值的函数

    //设置域值 

       public static string NavSetValue(XPathNavigator xn, string strXPath,XmlNamespaceManager xnm,string strValue)
        {
            try
            {
                if (xn != null)
                {
                    xn.SelectSingleNode(strXPath, xnm).SetValue(strValue);
                    return xn.Value;
                }
                else
                {
                    return "";
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

        }

      

    //读域值   

     public static string GetInnerXML(XPathNavigator xMain, XmlNamespaceManager xnm, string strXPath)
        {
            try
            {
                if (xMain != null)
                {
                    System.Xml.XmlNamespaceManager xNameSpace = new System.Xml.XmlNamespaceManager(new System.Xml.NameTable());
                    xNameSpace.AddNamespace("my", xnm.LookupNamespace("my").ToString());
                    System.Xml.XPath.XPathNavigator FieldNavn = xMain.SelectSingleNode(strXPath, xNameSpace);

                    return FieldNavn.InnerXml;
                }
                else
                {
                    return "";
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

    关于作者: 王昕(QQ:475660) 在广州工作生活30余年。十多年开发经验,在Java、即时通讯、NoSQL、BPM、大数据等领域较有经验。
    目前维护的开源产品:https://gitee.com/475660
  • 相关阅读:
    [NOI2016]循环之美(杜教筛)
    [CF600E]Dsu on tree
    [POI2015]Myjnie
    [POI2015]Odwiedziny
    [POI2015]Logistyka
    [POI2015]Wilcze doły
    [POI2017]Sabotaż
    [BZOJ3928/4048]Outer space invaders
    [BZOJ5109]大吉大利,晚上吃鸡!
    [AGC016E]Poor Turkeys
  • 原文地址:https://www.cnblogs.com/starcrm/p/1309811.html
Copyright © 2011-2022 走看看