How I end the create xml file as ...?
-
I am able to create a xml file as the following:
<testsuite error="0" failure="0" hostname="10.133.38.115" name="GIC_Test_API_3.12.0.3338" test="31" time="3304511345" timestamp="2014-05-23 13:26:56">
<testcase time="3304511345" name="GIC.FPA.GetLocation" classname="GIC.FPA">
<error type="GUI Radio priviledge" message="ne peut pas executer" />
</testcase>
</testsuite>with the follwing codes:
writer.WriteStartDocument(false);
writer.WriteStartElement("testsuite");writer.WriteAttributeString("error", "0");
writer.WriteAttributeString("failure", "0");
writer.WriteAttributeString("hostname", "10.133.38.115");
writer.WriteAttributeString("name", "GIC_Test_API_3.12.0.3338");
writer.WriteAttributeString("test", "31");
writer.WriteAttributeString("time", "3304511345");
writer.WriteAttributeString("timestamp", "2014-05-23 13:26:56");writer.WriteStartElement("testcase");
writer.WriteAttributeString("time", "3304511345");
writer.WriteAttributeString("name", "GIC.FPA.GetLocation");
writer.WriteAttributeString("classname", "GIC.FPA");writer.WriteStartElement("error");
writer.WriteAttributeString("type", "GUI Radio priviledge");
writer.WriteAttributeString("message", "ne peut pas executer");
writer.WriteEndElement();
writer.WriteEndElement();writer.WriteEndElement();
writer.WriteEndDocument();writer.Flush();
writer.Close();*) But I am required to complete the
<error .... /error>
as
<error type="GUI Radio priviledge" message="ne peut pas executer" /error>
I tried different approaches but failed ... someone can help? :doh: