本文整理汇总了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 ... />
}
示例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 ... />
}
示例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
}
示例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 ... />
}