pedram

pedram

  • NA
  • 13
  • 12.5k

Generate HTML string from an XML

Apr 16 2013 1:15 AM
    //My C# code
XmlTextReader reader = new XmlTextReader(@"D:\test.xml"); while (reader.Read()) { switch (reader.NodeType) { case XmlNodeType.Element: htmlstring+=reader.Name; break; case XmlNodeType.Text: htmlstring += reader.Value; break; } }

//My xml document

<Groups>
<Group1>
<Item1>
<GUID>124342345</GUID>
<Title>Name</Title>
<Type>Button</Type>
</Item1>
</Group1>
</Groups>

Answers (1)