XmlWriterSettings.ConformanceLevel Property
Silverlight
Gets or sets the level of conformance which the XmlWriter complies with.
Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
Property Value
Type: System.Xml.ConformanceLevelOne of the ConformanceLevel values. The default is ConformanceLevel.Document.
If the writer detects any information items that would violate the specified level of conformance, it throws an exception. In some cases, the writer automatically corrects the conformance error. For example, the writer closes an unclosed attribute without throwing an exception.
For more information and code examples, see XML Data.
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(); using (XmlWriter writer = XmlWriter.Create(strm, settings)) { writer.WriteElementString("orderID", "1-456-ab"); writer.WriteElementString("orderID", "2-36-00a"); writer.Flush(); } // Do additonal processing on the stream.
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.