Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How I end the create xml file as ...?

How I end the create xml file as ...?

Scheduled Pinned Locked Moved C#
helpxmlquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 10603967
    wrote on last edited by
    #1

    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:

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups