public static void Main(string[] args) { XmlValidator xml = new XmlValidator(); string test1 = "<sarcasm> Het komt<em> vast</em> goed </sarcasm>"; string test2 = "<sarcasm><em>Het komt vast goed</sarcasm></em>"; string test3 = "<sarcasm > Het komt<em> vast</em> goed </sarcasm>"; bool one = xml.Validate(test1); bool two = xml.Validate(test2); bool three = xml.Validate(test3); Console.WriteLine("test1: " + one + " test2: " + two + " test3: " + three); Console.ReadLine(); }
public static void Main(string[] args) { var xm = new XmlValidator(); Console.Write("Should be True:"); Console.WriteLine(); Console.WriteLine(xm.Validate("")); Console.WriteLine(xm.Validate("<html>Hallo Wereld</html>")); Console.WriteLine(xm.Validate("<html><body>Hallo Wereld</body></html>")); Console.WriteLine(xm.Validate("<html><body><i>Hallo</i> <b>Wereld</b> !</body></html>")); Console.WriteLine(""); Console.Write("Should be False:"); Console.WriteLine(); Console.WriteLine(xm.Validate("<html><body>Hallo Wereld</body>")); Console.WriteLine(xm.Validate("<html><body>Hallo Wereld</html></body>")); Console.WriteLine(xm.Validate("<html><body>Hallo Wereld</body></html></xml>")); Console.WriteLine(xm.Validate("<html><body> Hallo Wereld </html>")); Console.ReadKey(); }