http://bugzilla.novell.com/show_bug.cgi?id=499970
User [email protected] added comment http://bugzilla.novell.com/show_bug.cgi?id=499970#c2 Atsushi Enomoto <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |[email protected] Resolution| |WORKSFORME --- Comment #2 from Atsushi Enomoto <[email protected]> 2009-09-15 06:53:43 MDT --- Instead of not-runnable incomplete code fragment, I have created a completely runnable test case which is based on this report. However it does *not* show any difference between mono and .NET. using System; using System.IO; using System.Text; using System.Xml; using System.Windows.Forms; public class Test : Form { public static void Main (string [] args) { Application.Run (new Test (args)); } public Test (string [] args) { var t = XmlToTreeNode (new StreamReader (args [0]).ReadToEnd ()); TreeView tv = new TreeView (); tv.Dock = DockStyle.Fill; tv.Nodes.Add (t); Controls.Add (tv); } public static TreeNode XmlToTreeNode(string leXml) { TreeNode Result = null; try { XmlDocument doc = new XmlDocument(); doc.LoadXml(leXml); XmlNode RootNde = doc.ChildNodes.Item(0); if (string.IsNullOrEmpty(RootNde.Name) == false) Result = new TreeNode(RootNde.Name); foreach (XmlNode CurNode in RootNde.ChildNodes) { if (string.IsNullOrEmpty(CurNode.Name) == false) { TreeNode Nde = new TreeNode(CurNode.Name); Nde.Tag = CurNode.InnerText; if (CurNode.Attributes.Count > 0) { string AttrName = CurNode.Attributes[0].Name; string AttrVal = CurNode.Attributes[0].InnerText; TreeNode ChildNde = null; for (int i = 0; i < CurNode.Attributes.Count; i++) { ChildNde = new TreeNode(CurNode.Attributes[i].Name); ChildNde.Tag = CurNode.Attributes[i].InnerText; Nde.Nodes.Add(ChildNde); } } foreach (XmlNode item in CurNode.ChildNodes) { TreeNode Nde2 = new TreeNode(item.Name); Nde2.Tag = item.InnerText; if (item.Attributes != null && item.Attributes.Count > 0) { string AttrName2 = item.Attributes[0].Name; string AttrVal2 = item.Attributes[0].InnerText; TreeNode ChildNde2 = null; for (int i = 0; i < item.Attributes.Count; i++) { ChildNde2 = new TreeNode(item.Attributes[i].Name); ChildNde2.Tag = item.Attributes[i].InnerText; Nde2.Nodes.Add(ChildNde2); } } Nde.Nodes.Add(Nde2); } Result.Nodes.Add(Nde); } } } catch (Exception Ex) { Console.WriteLine("{0} {1} {2}", Ex.Message,Environment.NewLine, Ex.StackTrace); TreeNode Err = new TreeNode("Error"); return Err; } return Result; } } -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug. _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
