当前位置: 首页>>代码示例>>C#>>正文


C# XPathNavigator.MoveToFirstAttribute方法代码示例

本文整理汇总了C#中System.Xml.XPath.XPathNavigator.MoveToFirstAttribute方法的典型用法代码示例。如果您正苦于以下问题:C# XPathNavigator.MoveToFirstAttribute方法的具体用法?C# XPathNavigator.MoveToFirstAttribute怎么用?C# XPathNavigator.MoveToFirstAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Xml.XPath.XPathNavigator的用法示例。


在下文中一共展示了XPathNavigator.MoveToFirstAttribute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ReadXml

        public void ReadXml(XPathNavigator node)
        {
            if (node.MoveToFirstAttribute()) {

            do {
               if (String.IsNullOrEmpty(node.NamespaceURI)) {

                  switch (node.LocalName) {
                     case "address":
                        this.Address = node.Value;
                        break;

                     case "display-name":
                        this.DisplayName = node.Value;
                        break;

                     default:
                        break;
                  }
               }

            } while (node.MoveToNextAttribute());

            node.MoveToParent();
             }
        }
开发者ID:skurdiukov,项目名称:myxsl,代码行数:26,代码来源:XPathMailAddress.cs

示例2: Parse

		private void Parse(XPathNavigator classCacheElement)
		{
			if (classCacheElement.MoveToFirstAttribute())
			{
				do
				{
					switch (classCacheElement.Name)
					{
						case "class":
							if (classCacheElement.Value.Trim().Length == 0)
								throw new HibernateConfigException("Invalid class-cache element; the attribute <class> must be assigned with no empty value");
							clazz = classCacheElement.Value;
							break;
						case "usage":
							usage = EntityCacheUsageParser.Parse(classCacheElement.Value);
							break;
						case "region":
							region = classCacheElement.Value;
							break;
						case "include":
							include = CfgXmlHelper.ClassCacheIncludeConvertFrom(classCacheElement.Value);
							break;
					}
				}
				while (classCacheElement.MoveToNextAttribute());
			}			
		}
开发者ID:marchlud,项目名称:nhibernate-core,代码行数:27,代码来源:ClassCacheConfiguration.cs

示例3: XmlNodeTaskItem

        /// <summary>
        /// Initializes a new instance of an XmlNodeTaskItem
        /// </summary>
        /// <param name="xpathNavigator">The selected XmlNode</param>
        /// <param name="reservedMetaDataPrefix">The prefix to attach to the reserved metadata properties.</param>
        public XmlNodeTaskItem(XPathNavigator xpathNavigator, string reservedMetaDataPrefix)
        {
            this.ReservedMetaDataPrefix = reservedMetaDataPrefix;

            switch (xpathNavigator.NodeType)
            {
                case XPathNodeType.Attribute:
                    itemSpec = xpathNavigator.Value;
                    break;
                default:
                    itemSpec = xpathNavigator.Name;
                    break;
            }
            metaData.Add(ReservedMetaDataPrefix + "value", xpathNavigator.Value);
            metaData.Add(ReservedMetaDataPrefix + "innerXml", xpathNavigator.InnerXml);
            metaData.Add(ReservedMetaDataPrefix + "outerXml", xpathNavigator.OuterXml);

            if (xpathNavigator.MoveToFirstAttribute())
            {
                do
                {
                    metaData.Add(xpathNavigator.Name, xpathNavigator.Value);
                } while (xpathNavigator.MoveToNextAttribute());
            }
        }
开发者ID:trippleflux,项目名称:jezatools,代码行数:30,代码来源:XmlNodeTaskItem.cs

示例4: ParameterNode

        public ParameterNode(XPathNavigator aNode)
        {

            valueNode = String.Empty;
            typeNode = String.Empty;
            ruleValueNode = String.Empty;
            name = String.Empty;

            if (aNode.MoveToFirstAttribute())
            {
                do
                {
                    string nodeName = aNode.Name;
                    switch (nodeName)
                    {
                        case PARAMETER_ATTRS.NAME:
                            name = aNode.Value;
                            break;
                        case PARAMETER_ATTRS.VALUE:
                            valueNode = aNode.Value;
                            break;
                        case PARAMETER_ATTRS.TYPE:
                            typeNode = aNode.Value;
                            break;
                        case PARAMETER_ATTRS.RULE_VALUE:
                            ruleValueNode = aNode.Value;
                            break;
                    }
                } while (aNode.MoveToNextAttribute());
                aNode.MoveToParent();
            }

        }
开发者ID:killbug2004,项目名称:WSProf,代码行数:33,代码来源:ParameterNode.cs

示例5: MSXslScript

			public MSXslScript (XPathNavigator nav, Evidence evidence)
			{
				this.evidence = evidence;
				code = nav.Value;
				if (nav.MoveToFirstAttribute ()) {
					do {
						switch (nav.LocalName) {
						case "language":
							switch (nav.Value.ToLower (CultureInfo.InvariantCulture)) {
							case "jscript":
							case "javascript":
								language = ScriptingLanguage.JScript; break;
							case "vb":
							case "visualbasic":
								language = ScriptingLanguage.VisualBasic;
								break;
							case "c#":
							case "csharp":
								language = ScriptingLanguage.CSharp;
								break;
							default:
								throw new XsltException ("Invalid scripting language!", null);
							}
							break;
						case "implements-prefix":
							implementsPrefix = nav.Value;
							break;
						}
					} while (nav.MoveToNextAttribute ());
					nav.MoveToParent ();
				}
				
				if (implementsPrefix == null)
					throw new XsltException ("need implements-prefix attr", null);
			}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:35,代码来源:MSXslScriptManager.cs

示例6: ReadXml

        public void ReadXml(XPathNavigator node, XmlResolver resolver)
        {
            if (node.NodeType == XPathNodeType.Element) {

            if (node.MoveToFirstAttribute()) {
               do {
                  switch (node.LocalName) {
                     case "media-type":
                        this.MediaType = node.Value;
                        break;

                     case "boundary":
                        this.Boundary = node.Value;
                        break;
                  }
               } while (node.MoveToNextAttribute());

               node.MoveToParent();
            }

            if (node.MoveToChild(XPathNodeType.Element)) {

               XPathHttpMultipartItem currentItem = null;

               do {
                  if (node.NamespaceURI == XPathHttpClient.Namespace) {

                     switch (node.LocalName) {
                        case "header":
                           if (currentItem == null) {
                              currentItem = new XPathHttpMultipartItem();
                           }

                           currentItem.Headers.Add(node.GetAttribute("name", ""), node.GetAttribute("value", ""));
                           break;

                        case "body":
                           if (currentItem == null) {
                              currentItem = new XPathHttpMultipartItem();
                           }

                           currentItem.Body = new XPathHttpBody();
                           currentItem.Body.ReadXml(node, resolver);

                           this.Items.Add(currentItem);
                           currentItem = null;
                           break;
                     }
                  }

               } while (node.MoveToNext(XPathNodeType.Element));

               node.MoveToParent();
            }
             }
        }
开发者ID:skurdiukov,项目名称:myxsl,代码行数:56,代码来源:XPathHttpMultipart.cs

示例7: Parse

		private void Parse(XPathNavigator eventElement)
		{
			XPathNavigator eventClone = eventElement.Clone();
			eventElement.MoveToFirstAttribute();
			type = CfgXmlHelper.ListenerTypeConvertFrom(eventElement.Value);
			XPathNodeIterator listenersI = eventClone.SelectDescendants(XPathNodeType.Element, false);
			while (listenersI.MoveNext())
			{
				listeners.Add(new ListenerConfiguration(listenersI.Current, type));
			}
		}
开发者ID:jlevitt,项目名称:nhibernate-core,代码行数:11,代码来源:EventConfiguration.cs

示例8: GetAssemblyVersion

 string GetAssemblyVersion(XPathNavigator nav)
 {
     if(nav.HasAttributes)
         nav.MoveToFirstAttribute();
     do
     {
         if (Utilities.Compare(nav.LocalName, "version"))
             return nav.Value;
     } while (nav.MoveToNextAttribute( ));
     return string.Empty;
 }
开发者ID:eleooo,项目名称:App,代码行数:11,代码来源:EleoooClient.aspx.cs

示例9: SettingsMappingWhatContents

		public SettingsMappingWhatContents (XPathNavigator nav, SettingsMappingWhatOperation operation)
		{
			_operation = operation;
      
			if (nav.HasAttributes) {	
				nav.MoveToFirstAttribute ();
				_attributes.Add (nav.Name, nav.Value);
	
				while (nav.MoveToNextAttribute ())
					_attributes.Add (nav.Name, nav.Value);
			}
		}
开发者ID:nlhepler,项目名称:mono,代码行数:12,代码来源:SettingsMappingWhat.cs

示例10: GetAttributes

 public static Dictionary<string, string> GetAttributes(XPathNavigator navigator)
 {
     if (!navigator.MoveToFirstAttribute())
         throw new DeserializationException("Node has no attributes: " + navigator.Name);
     Dictionary<string, string> attributes = new Dictionary<string, string>();
     do
     {
         attributes.Add(navigator.Name, navigator.Value);
     } while (navigator.MoveToNextAttribute());
     navigator.MoveToParent();
     return attributes;
 }
开发者ID:joaohortencio,项目名称:n2cms,代码行数:12,代码来源:XmlReader.cs

示例11: ReadXml

      public void ReadXml(XPathNavigator node) {

         if (node.MoveToFirstAttribute()) {

            do {
               if (String.IsNullOrEmpty(node.NamespaceURI)) {

                  switch (node.LocalName) {
                     case "method":
                        switch (node.Value) {
                           case "xml":
                              this.Method = XmlSerializationOptions.Methods.Xml;
                              break;

                           case "html":
                              this.Method = XmlSerializationOptions.Methods.Html;
                              break;

                           case "xhtml":
                              this.Method = XmlSerializationOptions.Methods.XHtml;
                              break;

                           case "text":
                              this.Method = XmlSerializationOptions.Methods.Text;
                              break;
                        }
                        break;

                     default:
                        break;
                  }
               }
            } while (node.MoveToNextAttribute());

            node.MoveToParent();
         }

         if (node.MoveToFirstChild()) {

            do {
               if (node.NodeType == XPathNodeType.Element || node.NodeType == XPathNodeType.Text) {
                  this.Content = node.Clone();
                  break;
               }

            } while (node.MoveToNext());

            node.MoveToParent();
         }
      }
开发者ID:nuxleus,项目名称:Nuxleus,代码行数:50,代码来源:XPathMailBody.cs

示例12: WriteAttributes

        private static void WriteAttributes(TextWriter writer, XPathNavigator nav, string leadIn)
        {
            nav.MoveToFirstAttribute();

            do
            {
                writer.Write(leadIn);
                writer.Write(nav.Name);
                writer.Write(Constants.Space);
                writer.WriteLine(nav.Value);
            } while (nav.MoveToNextAttribute());

            nav.MoveToParent();
        }
开发者ID:nick-randal,项目名称:UsefulCSharp,代码行数:14,代码来源:QuickXmlGenerator.cs

示例13: ParseAppTag

        /// <summary>
        /// Parses the "version" node represented by a <see cref="XPathNavigator"/> object.
        /// </summary>
        /// <param name="xpathNav">The <see cref="XPathNavigator"/> object containing the "version" node.</param>
        /// <returns>An instance of the <see cref="AppVersionInfo"/> class.</returns>
        /// <exception cref="VersionCheckingException"></exception>
        private static AppVersionInfo ParseAppTag(XPathNavigator xpathNav)
        {
            string name = null;
            Version version = null;
            string informationalVersion = null;
            string description = null;
            string downloadUrl = null;

            if (xpathNav.MoveToFirstAttribute())
            {
                do
                {
                    switch (xpathNav.Name)
                    {
                        case "name":
                            name = xpathNav.Value;
                            break;

                        case "version":
                            try
                            {
                                version = new Version(xpathNav.Value);
                            }
                            catch (Exception ex)
                            {
                                throw new VersionCheckingException(VersioningResources.Error_VersionInformation_InvalidVersionsFile_InvalidVersionAttribute, ex);
                            }
                            break;

                        case "informationalVersion":
                            informationalVersion = xpathNav.Value;
                            break;

                        case "description":
                            description = xpathNav.Value;
                            break;

                        case "downloadUrl":
                            downloadUrl = xpathNav.Value;
                            break;
                    }
                } while (xpathNav.MoveToNextAttribute());
            }

            if (version == null)
                throw new VersionCheckingException(VersioningResources.Error_VersionInformation_VersionAttributeNotFound);

            return new AppVersionInfo(name, version, informationalVersion, description, downloadUrl);
        }
开发者ID:lastunicorn,项目名称:Acarus,代码行数:55,代码来源:AppInfoFileParser.cs

示例14: AddAttributeList

 private void AddAttributeList(XPathNavigator nav, ArrayList attrs)
 {
     if (nav.HasAttributes)
     {
         nav.MoveToFirstAttribute();
         do
         {
             if (!attrs.Contains(nav.Name))
             {
                 attrs.Add(nav.Name);
             }
         }
         while (nav.MoveToNextAttribute());
         nav.MoveToParent();
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:16,代码来源:XmlDocumentSchema.cs

示例15: TraceContext

		internal static void TraceContext(XPathNavigator context) {
			string output = "(null)";
			
			if (context != null) {
				context = context.Clone ();
				switch (context.NodeType) {
					case XPathNodeType.Element:
						output = string.Format("<{0}:{1}", context.Prefix, context.LocalName);
						for (bool attr = context.MoveToFirstAttribute(); attr; attr = context.MoveToNextAttribute()) {
							output += string.Format(CultureInfo.InvariantCulture, " {0}:{1}={2}", context.Prefix, context.LocalName, context.Value);
						}
						 output += ">";
						break;
					default:
						break;
				}
			}
	
			WriteLine(output);
		}
开发者ID:nobled,项目名称:mono,代码行数:20,代码来源:Debug.cs


注:本文中的System.Xml.XPath.XPathNavigator.MoveToFirstAttribute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。