Author: jonpryor
Date: 2007-07-19 09:19:40 -0400 (Thu, 19 Jul 2007)
New Revision: 82284

Modified:
   trunk/monodoc/tools/ChangeLog
   trunk/monodoc/tools/monodocer.cs
Log:
        * monodocer.cs: Always fully consume <Docs/> children.  If we have e.g.
          <Docs><param name="foo"><see cref="T:Bar"/></param></Docs>, but there 
is
          no existing parameter "foo", we would previously process the nested
          <see/> node and append it to the <Docs/> child nodes.


Modified: trunk/monodoc/tools/ChangeLog
===================================================================
--- trunk/monodoc/tools/ChangeLog       2007-07-19 12:52:33 UTC (rev 82283)
+++ trunk/monodoc/tools/ChangeLog       2007-07-19 13:19:40 UTC (rev 82284)
@@ -1,3 +1,10 @@
+2007-07-19  Jonathan Pryor  <[EMAIL PROTECTED]>
+
+       * monodocer.cs: Always fully consume <Docs/> children.  If we have e.g.
+         <Docs><param name="foo"><see cref="T:Bar"/></param></Docs>, but there 
is
+         no existing parameter "foo", we would previously process the nested
+         <see/> node and append it to the <Docs/> child nodes.
+
 2007-07-18  Jonathan Pryor  <[EMAIL PROTECTED]>
 
        * monodocer.cs: Change OrderDocsNodes() so that it uses

Modified: trunk/monodoc/tools/monodocer.cs
===================================================================
--- trunk/monodoc/tools/monodocer.cs    2007-07-19 12:52:33 UTC (rev 82283)
+++ trunk/monodoc/tools/monodocer.cs    2007-07-19 13:19:40 UTC (rev 82284)
@@ -1524,32 +1524,38 @@
                                }
                                if (!r.IsStartElement ())
                                        continue;
+                               Console.WriteLine ("# Processing element: " + 
r.Name + "; Depth=" + r.Depth);
                                switch (r.Name) {
                                        case "param":
                                        case "typeparam": {
                                                XmlNode doc = 
e.SelectSingleNode (
                                                                r.Name + 
"[EMAIL PROTECTED]'" + r.GetAttribute ("name") + "']");
+                                               string value = r.ReadInnerXml 
();
                                                if (doc != null)
-                                                       doc.InnerXml = 
r.ReadInnerXml ().Replace ("\r", "");
+                                                       doc.InnerXml = 
value.Replace ("\r", "");
                                                break;
                                        }
                                        case "altmember":
                                        case "exception":
                                        case "permission":
                                        case "seealso": {
+                                               string name = r.Name;
+                                               string cref = r.GetAttribute 
("cref");
                                                XmlNode doc = 
e.SelectSingleNode (
-                                                               r.Name + 
"[EMAIL PROTECTED]'" + r.GetAttribute ("cref") + "']");
+                                                               r.Name + 
"[EMAIL PROTECTED]'" + cref + "']");
+                                               string value = r.ReadInnerXml 
().Replace ("\r", "");
                                                if (doc != null)
-                                                       doc.InnerXml = 
r.ReadInnerXml ().Replace ("\r", "");
+                                                       doc.InnerXml = value;
                                                else {
-                                                       XmlElement n = 
e.OwnerDocument.CreateElement (r.Name);
-                                                       n.SetAttribute ("cref", 
r.GetAttribute ("cref"));
-                                                       n.InnerXml = 
r.ReadInnerXml ();
+                                                       XmlElement n = 
e.OwnerDocument.CreateElement (name);
+                                                       n.SetAttribute ("cref", 
cref);
+                                                       n.InnerXml = value;
                                                        e.AppendChild (n);
                                                }
                                                break;
                                        }
                                        default: {
+                                               string name = r.Name;
                                                string xpath = r.Name;
                                                StringList attributes = new 
StringList (r.AttributeCount);
                                                if (r.MoveToFirstAttribute ()) {
@@ -1562,12 +1568,13 @@
                                                        xpath += "[" + 
string.Join (" and ", DocUtils.ToStringArray (attributes)) + "]";
                                                }
                                                XmlNode doc = 
e.SelectSingleNode (xpath);
+                                               string value = r.ReadInnerXml 
().Replace ("\r", "");
                                                if (doc != null) {
-                                                       doc.InnerXml = 
r.ReadInnerXml ().Replace ("\r", "");
+                                                       doc.InnerXml = value;
                                                }
                                                else {
-                                                       XmlElement n = 
e.OwnerDocument.CreateElement (r.Name);
-                                                       n.InnerXml = 
r.ReadInnerXml ();
+                                                       XmlElement n = 
e.OwnerDocument.CreateElement (name);
+                                                       n.InnerXml = value;
                                                        foreach (string a in 
attributes) {
                                                                int eq = 
a.IndexOf ('=');
                                                                n.SetAttribute 
(a.Substring (1, eq-1), a.Substring (eq+2, a.Length-eq-3));

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to