[Mono-bugs] [Bug 44165][Nor] New - XMLDataDocument doesn't work

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Wed, 4 Jun 2003 19:16:15 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by ljones@lithonia.com.

http://bugzilla.ximian.com/show_bug.cgi?id=44165

--- shadow/44165	Wed Jun  4 19:16:15 2003
+++ shadow/44165.tmp.17642	Wed Jun  4 19:16:15 2003
@@ -0,0 +1,118 @@
+Bug#: 44165
+Product: Mono/Class Libraries
+Version: unspecified
+OS: Red Hat 9.0
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: System.XML
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: ljones@lithonia.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: XMLDataDocument doesn't work
+
+Please fill in this template when reporting a bug, unless you know what 
+you are doing.
+Description of Problem:
+
+
+Steps to reproduce the problem:
+1.Here is sample xml file:
+<RecipeList>
+  <Recipe>
+    <Name>
+      French Toast
+    </Name>
+    <Ingredients>
+      <Ingredient>
+        Bread
+      </Ingredient>
+      <Ingredient>
+        Butter
+      </Ingredient>
+      <Ingredient>
+        Sugar
+      </Ingredient>
+    </Ingredients>
+  </Recipe>
+  <Recipe>
+    <Name>
+      Tomato Soup
+    </Name>
+    <Ingredients>
+      <Ingredient>
+        Tomatoes
+      </Ingredient>
+      <Ingredient>
+        Water
+      </Ingredient>
+    </Ingredients>
+  </Recipe>
+</RecipeList>
+2. Here is the aspx page:
+<%@ Import Namespace="System.Data" %>
+<%@ Import Namespace="System.Xml" %>
+<%@ Page Language="C#" %>
+
+<Script Runat="Server">
+
+void Page_Load(object o, EventArgs e)
+{
+  DataSet dstRecipes;
+  XmlDataDocument objDataDocument;
+  XmlNodeList objRecipes;
+
+  dstRecipes = new DataSet();
+  dstRecipes.ReadXml(MapPath("Recipes.xml"));
+
+  objDataDocument = new XmlDataDocument(dstRecipes);
+  objRecipes = objDataDocument.GetElementsByTagName("Ingredient");
+  foreach (XmlNode objRecipe in objRecipes) {
+	lblOutput.Text += objRecipe.InnerXml;
+  }
+}
+</Script>
+
+<html>
+<head><title>XmlDataDocument.aspx</title></head>
+<body>
+<asp:Label
+  ID="lblOutput"
+  Runat="Server" />
+</body>
+</html>
+3. Here is the error messages:
+System.Data.DuplicateNameException: A column named 'Ingredient' already 
+belongs to this DataTable.in <0x00253> 00 
+System.Data.DataColumnCollection:Add (System.Data.DataColumn)in <0x00087> 
+00 System.Data.DataColumnCollection:Add (string)in <0x00327> 00 
+System.Data.XmlDataLoader:ReadModeInferSchema (System.Xml.XmlReader)in 
+<0x000a1> 00 System.Data.XmlDataLoader:LoadData 
+(System.Xml.XmlReader,System.Data.XmlReadMode)in <0x000ad> 00 
+System.Data.DataSet:ReadXml (System.Xml.XmlReader,System.Data.XmlReadMode)
+in <0x000fd> 00 System.Data.DataSet:ReadXml (System.Xml.XmlReader)in 
+<0x0003d> 00 System.Data.DataSet:ReadXml (string)in <0x00085> 00 
+ASP.Listing13_12_aspx:Page_Load (object,System.EventArgs)in <0x00081> 01 
+System.MulticastDelegate:invoke_void_object_EventArgs 
+(object,System.EventArgs)in <0x0008a> 00 System.Web.UI.Control:OnLoad 
+(System.EventArgs)in <0x00033> 00 System.Web.UI.Control:LoadRecursive ()in 
+<0x000b8> 00 System.Web.UI.Page:ProcessRequest (System.Web.HttpContext)in 
+<0x001b9> 00 .ExecuteHandlerState:Execute ()in <0x00052> 
+00 .StateMachine:ExecuteState (IStateHandler,bool&)
+
+
+Actual Results:
+See 3. above
+
+Expected Results:
+On MS .NET this exact same program anf file prints out node names
+
+How often does this happen? 
+always
+
+Additional Information: