Remove monod from the build, a new C# version is coming
[mono.git] / status / ByNamespace.cs
1 //
2 // ByNamespace.cs
3 //
4 // Author:
5 //    Sean MacIsaac (sean@ximian.com)
6 //
7 // (C) Ximian, Inc.   http://www.ximian.com
8 //
9
10 using System;
11 using System.Collections;
12 using System.IO;
13 using System.Xml;
14 using System.Xml.Xsl;
15 using System.Xml.XPath;
16
17 namespace Mono.StatusReporter {
18         public class ByMaintainer {
19                 static int Main (string[] args) {
20                         XslTransform xslt = new XslTransform ();
21                         xslt.Load ("ByNamespace.xsl");
22                         //StreamWriter sw = new StreamWriter ("bn/index");
23
24                         XPathDocument doc = new XPathDocument ("class.xml");
25
26                         XmlDocument classxml = new XmlDocument ();
27                         classxml.Load ("class.xml");
28                         ArrayList nsList = new ArrayList ();
29
30                         XmlNodeList classes = classxml.GetElementsByTagName ("class");
31                         foreach (XmlNode node in classes) {
32                                 string name = node.Attributes.GetNamedItem ("name").Value;
33                                 string ns = name.Substring(0, name.LastIndexOf ("."));
34                                 if (!nsList.Contains (ns)) nsList.Add (ns);
35                         }
36
37                         foreach (string str in nsList) {
38                                 //sw.WriteLine ("<li><a href=\"" + str + ".html\">" + str + "</a>");
39
40                                 XmlWriter writer = new XmlTextWriter ("src/" + str, null);
41
42                                 XsltArgumentList xslArg = new XsltArgumentList ();
43                                 xslArg.AddParam ("ns", "", str);
44
45                                 xslt.Transform (doc, xslArg, writer);
46
47                                 writer.Close ();
48                         }
49
50                         //sw.Close ();
51
52                         return 0;
53                 }
54         }
55 }