本文整理匯總了C#中System.Xml.XmlTextReader.SetNameTable方法的典型用法代碼示例。如果您正苦於以下問題:C# XmlTextReader.SetNameTable方法的具體用法?C# XmlTextReader.SetNameTable怎麽用?C# XmlTextReader.SetNameTable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Xml.XmlTextReader
的用法示例。
在下文中一共展示了XmlTextReader.SetNameTable方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: CreateCustomizedTextReader
private static XmlReader CreateCustomizedTextReader (XmlTextReader reader, XmlReaderSettings settings)
{
reader.XmlResolver = settings.XmlResolver;
// Normalization is set true by default.
reader.Normalization = true;
reader.EntityHandling = EntityHandling.ExpandEntities;
if (settings.ProhibitDtd)
reader.ProhibitDtd = true;
if (!settings.CheckCharacters)
reader.CharacterChecking = false;
// I guess it might be changed in 2.0 RTM to set true
// as default, or just disappear. It goes against
// XmlTextReader's default usage and users will have
// to close input manually (that's annoying). Moreover,
// MS XmlTextReader consumes text input more than
// actually read and users can acquire those extra
// consumption by GetRemainder() that returns different
// TextReader.
reader.CloseInput = settings.CloseInput;
// I would like to support it in detail later;
// MSDN description looks source of confusion. We don't
// need examples, but precise list of how it works.
reader.Conformance = settings.ConformanceLevel;
reader.AdjustLineInfoOffset (settings.LineNumberOffset,
settings.LinePositionOffset);
if (settings.NameTable != null)
reader.SetNameTable (settings.NameTable);
XmlReader r = CreateFilteredXmlReader (reader, settings);
r.settings = settings;
return r;
}