update MEF to preview 9
[mcs.git] / tools / mdoc / Mono.Documentation / normalize.cs
blob724c7277eadaa79e0747a7fe1e2dff3501b9a509
1 using System;
2 using System.IO;
3 using System.Text;
4 using System.Xml;
6 namespace Mono.Documentation {
7 public class Normalizer {
9 public static void Run (string [] args)
11 if (args == null) {
12 Console.WriteLine ("normalize.exe <files>");
13 Environment.Exit (0);
16 foreach (string arg in args) {
18 XmlDocument document = new XmlDocument ();
19 try {
20 document.Load (arg);
21 StreamWriter writer = new StreamWriter (arg, false, new UTF8Encoding (false));
22 document.Save (writer);
23 writer.Close ();
25 } catch (XmlException e) {
26 Console.WriteLine (arg + " is not a wellformed XML document.");
27 Console.WriteLine (e.Message);