Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

33 lines
1.1 KiB
C#

using System;
using System.IO;
using System.Text;
using System.Xml;
namespace Mono.Documentation {
public class Normalizer {
public static void Run (string [] args)
{
if (args == null) {
Console.WriteLine ("normalize.exe <files>");
Environment.Exit (0);
}
foreach (string arg in args) {
XmlDocument document = new XmlDocument ();
try {
document.Load (arg);
StreamWriter writer = new StreamWriter (arg, false, new UTF8Encoding (false));
document.Save (writer);
writer.Close ();
} catch (XmlException e) {
Console.WriteLine (arg + " is not a wellformed XML document.");
Console.WriteLine (e.Message);
}
}
}
}
}