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;
            }
        }

  • 相关阅读:
    偏函数
    装饰器
    排序
    匿名函数
    参数传递
    pass语句
    不定长函数
    通用函数
    不定长参数(元祖)
    不定长参数(字典)
  • 原文地址:https://www.cnblogs.com/IsNull/p/1804115.html
Copyright © 2011-2022 走看看