536cd135cc
Former-commit-id: 5624ac747d633e885131e8349322922b6a59baaa
33 lines
1.1 KiB
C#
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);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|