Verifies the XML is well formed. - CSharp System.Xml

CSharp examples for System.Xml:XML Reader

Description

Verifies the XML is well formed.

Demo Code


using System.Xml.Serialization;
using System.IO;/*from w w  w . j ava  2 s .c o m*/
using System.Xml;
using System.Text.RegularExpressions;
using System;

public class Main{
        /// <summary>
        /// Verifies the XML is well formed.   
        /// </summary>
        /// <param name="actual">The actual.</param>
        /// <remarks></remarks>
      public static void VerifyXmlIsWellFormed(string actual)
      {
         XmlDocument document = new XmlDocument();
         document.LoadXml(actual);
      }
}

Related Tutorials