When I use the XMLWriterTraceListener to log Tracemessages I get an output similar to this:


<E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
<
System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
<
EventID>1</EventID>
<
Type>3</Type>
<
SubType Name="Error">0</SubType>
<
Level>2</Level>
<
TimeCreated SystemTime="2006-10-10T13:15:14.5919177Z" />
<
Source Name="xmlSource" />
<
Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" />
<
Execution ProcessName="XMLTracingTest.vshost" ProcessID="5600" ThreadID="10" />
<
Channel/>
<
Computer>AISPC466A</Computer>
</
System>
<
ApplicationData>
<
TraceData>
<
DataItem>Hello Tracedata</DataItem>
<
DataItem>http://www.google.de/</DataItem>
<
DataItem>string2</DataItem>
</
TraceData>
</
ApplicationData>
</
E2ETraceEvent>
<
E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
<
System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
...


Obviously the XML is not well formed since it has no root element. Also it includes those two xmlns for each traceevent, wich clutters and bloats the xml. Is there a way I can overcome these two shortcomings ?




http://bitbonk.spaces.live.com