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


C# XmlReader.IsTextNode方法代码示例

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


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

示例1: ReadSourceFeed

		void ReadSourceFeed (XmlReader reader, SyndicationFeed feed)
		{
			if (reader.MoveToFirstAttribute ()) {
				do {
					if (reader.NamespaceURI == "http://www.w3.org/2000/xmlns/")
						continue;
					if (reader.NamespaceURI == String.Empty) {
						switch (reader.LocalName) {
						case "url":
							feed.Links.Add (new SyndicationLink (CreateUri (reader.Value)));
							continue;
						}
					}
				} while (reader.MoveToNextAttribute ());
				reader.MoveToElement ();
			}

			if (!reader.IsEmptyElement) {
				reader.Read ();
				string title = null;
				while (reader.NodeType != XmlNodeType.EndElement) {
					if (reader.IsTextNode ())
						title += reader.Value;
					reader.Skip ();
					reader.MoveToContent ();
				}
				feed.Title = new TextSyndicationContent (title);
			}
			reader.Read (); // </source> or <source ... />
		}
开发者ID:nickchal,项目名称:pash,代码行数:30,代码来源:Rss20ItemFormatter.cs

示例2: ReadLink

		void ReadLink (XmlReader reader, SyndicationLink link)
		{
			if (PreserveAttributeExtensions && reader.MoveToFirstAttribute ()) {
				do {
					if (reader.NamespaceURI == "http://www.w3.org/2000/xmlns/")
						continue;
					if (!TryParseAttribute (reader.LocalName, reader.NamespaceURI, reader.Value, link, Version))
						link.AttributeExtensions.Add (new XmlQualifiedName (reader.LocalName, reader.NamespaceURI), reader.Value);
				} while (reader.MoveToNextAttribute ());
				reader.MoveToElement ();
			}

			if (!reader.IsEmptyElement) {
				string url = null;
				reader.Read ();
				for (reader.MoveToContent (); reader.NodeType != XmlNodeType.EndElement; reader.MoveToContent ()) {
					if (reader.IsTextNode ())
						url += reader.Value;
					else if (!TryParseElement (reader, link, Version)) {
						if (PreserveElementExtensions)
							// FIXME: what should be used for maxExtenswionSize
							LoadElementExtensions (reader, link, int.MaxValue);
						else
							reader.Skip ();
					}
					reader.Read ();
				}
				link.Uri = CreateUri (url);
			}
			reader.Read (); // </link> or <link ... />
		}
开发者ID:nickchal,项目名称:pash,代码行数:31,代码来源:Rss20ItemFormatter.cs

示例3: ReadPerson

		void ReadPerson (XmlReader reader, SyndicationPerson person)
		{
			if (PreserveAttributeExtensions && reader.MoveToFirstAttribute ()) {
				do {
					if (reader.NamespaceURI == "http://www.w3.org/2000/xmlns/")
						continue;
					if (!TryParseAttribute (reader.LocalName, reader.NamespaceURI, reader.Value, person, Version))
						person.AttributeExtensions.Add (new XmlQualifiedName (reader.LocalName, reader.NamespaceURI), reader.Value);
				} while (reader.MoveToNextAttribute ());
				reader.MoveToElement ();
			}

			if (!reader.IsEmptyElement) {
				reader.Read ();
				for (reader.MoveToContent (); reader.NodeType != XmlNodeType.EndElement; reader.MoveToContent ()) {
					if (reader.IsTextNode ())
						person.Email += reader.Value;
					else if (!TryParseElement (reader, person, Version)) {
						if (PreserveElementExtensions)
							// FIXME: what should be used for maxExtenswionSize
							LoadElementExtensions (reader, person, int.MaxValue);
						else
							reader.Skip ();
					}
					reader.Read ();
				}
			}
			reader.Read (); // end element or empty element
		}
开发者ID:nickchal,项目名称:pash,代码行数:29,代码来源:Rss20ItemFormatter.cs

示例4: ReadCategory

		void ReadCategory (XmlReader reader, SyndicationCategory category)
		{
			if (reader.MoveToFirstAttribute ()) {
				do {
					if (reader.NamespaceURI == "http://www.w3.org/2000/xmlns/")
						continue;
					if (reader.NamespaceURI == String.Empty) {
						switch (reader.LocalName) {
						case "domain":
							category.Scheme = reader.Value;
							continue;
						}
					}
					if (PreserveAttributeExtensions)
						if (!TryParseAttribute (reader.LocalName, reader.NamespaceURI, reader.Value, category, Version))
							category.AttributeExtensions.Add (new XmlQualifiedName (reader.LocalName, reader.NamespaceURI), reader.Value);
				} while (reader.MoveToNextAttribute ());
				reader.MoveToElement ();
			}

			if (!reader.IsEmptyElement) {
				reader.Read ();
				for (reader.MoveToContent (); reader.NodeType != XmlNodeType.EndElement; reader.MoveToContent ()) {
					if (reader.IsTextNode ())
						category.Name += reader.Value;
					else if (!TryParseElement (reader, category, Version)) {
						if (PreserveElementExtensions)
							// FIXME: what should be used for maxExtenswionSize
							LoadElementExtensions (reader, category, int.MaxValue);
						else
							reader.Skip ();
					}
					reader.Read ();
				}
			}
			reader.Read (); // </category> or <category ... />
		}
开发者ID:nickchal,项目名称:pash,代码行数:37,代码来源:Rss20ItemFormatter.cs


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