XmlWriterSettings.ConformanceLevel プロパティ
アセンブリ: System.Xml (system.xml.dll 内)

Dim instance As XmlWriterSettings Dim value As ConformanceLevel value = instance.ConformanceLevel instance.ConformanceLevel = value
public: property ConformanceLevel ConformanceLevel { ConformanceLevel get (); void set (ConformanceLevel value); }
/** @property */ public ConformanceLevel get_ConformanceLevel () /** @property */ public void set_ConformanceLevel (ConformanceLevel value)
public function get ConformanceLevel () : ConformanceLevel public function set ConformanceLevel (value : ConformanceLevel)
ConformanceLevel 値の 1 つ。既定値は ConformanceLevel.Document です。

ライタは、指定された準拠のレベルに違反する情報アイテムを検出すると、例外をスローします。場合によっては、ライタが準拠エラーを自動的に修正します。たとえば、ライタは例外をスローすることなく、閉じられていない属性を閉じます。

XML フラグメントをメモリ ストリームに書き込む例を次に示します。
Dim settings As XmlWriterSettings = New XmlWriterSettings() settings.OmitXmlDeclaration = true settings.ConformanceLevel = ConformanceLevel.Fragment settings.CloseOutput = false ' Create the XmlWriter object and write some content. Dim strm as MemoryStream = new MemoryStream() Dim writer As XmlWriter = XmlWriter.Create(strm, settings) writer.WriteElementString("orderID", "1-456-ab") writer.WriteElementString("orderID", "2-36-00a") writer.Flush() writer.Close() ' Do additonal processing on the stream.
XmlWriterSettings settings = new XmlWriterSettings(); settings.OmitXmlDeclaration = true; settings.ConformanceLevel = ConformanceLevel.Fragment; settings.CloseOutput = false; // Create the XmlWriter object and write some content. MemoryStream strm = new MemoryStream(); XmlWriter writer = XmlWriter.Create(strm, settings); writer.WriteElementString("orderID", "1-456-ab"); writer.WriteElementString("orderID", "2-36-00a"); writer.Flush(); writer.Close(); // Do additonal processing on the stream.

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- XmlWriterSettings.ConformanceLevel プロパティのページへのリンク