tags:

views:

18

answers:

2

I am generating the xml output of nunit tests using:

 nunit-console /xml:console-test.xml nunit.tests.dll

How can I create a table formatted report using the xml. Is there any tool for that?

A: 

You can bind xml to a datagrid to display it as a table with a handful of lines of C#.

http://www.csharphelp.com/2006/10/binding-raw-xml-to-a-datagrid-control-in-asp-net/

Something like:

DataSet ds = new DataSet(); 
ds.ReadXml(Server.MapPath("console-test.xml"),XmlReadMode.InferSchema); 
this.DataGrid1.DataSource = ds; 
this.DataGrid1.DataBind();
amelvin
Problem with this is (at least for NUnit 2.5.5) that the structure of the XML file is not well formed, and throws the following error at runtime: 'The table (test-suite) cannot be the child table to itself in nested relations.'
jlech
A: 

Or use an XSLT transformer to generate the HTML from the xml.

cristobalito