/ Published in: C#
Ektron smartform data contains a xml nodelist which I put in a data table and parse out into an html table
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
XmlNodeList floorplans = xmlDoc.SelectNodes("/Property/Floorplans/Floorplan"); numberOfRooms = floorplans.Count; dtRooms.Columns.Add("roomType"); dtRooms.Columns.Add("Level"); dtRooms.Columns.Add("Dimensions"); for (int i = 0; i < floorplans.Count; i++) { try { XmlNode roomNode = floorplans.Item(i); string roomType = floorplans[i].Attributes["UnitType"].InnerText; string level = floorplans[i].Attributes["Level"].InnerText; string Dimensions = floorplans[i].InnerText; dtRooms.Rows.Add(roomType, level, Dimensions); } catch (NullReferenceException e) { roomError.Text = e.Message; } } repeaterRooms.DataSource = dtRooms; repeaterRooms.DataBind();