XML Output Format

The XML output format writes output records as XML document nodes.

Users can choose between four different structures for the output XML document.
Different structures format the output record fields in different ways, giving users the ability to fine-tune the generated XML for their applications.

The following example command generates an XML document containing fields from the System event log:

LogParser "SELECT TimeGenerated, SourceName, EventID, Message INTO Events.xml FROM System"
The output XML will look like the following example:
<?xml version="1.0" encoding="ISO-10646-UCS-2" standalone="yes" ?>
<!DOCTYPE ROOT[
 <!ATTLIST ROOT DATE_CREATED CDATA #REQUIRED>
 <!ATTLIST ROOT CREATED_BY CDATA #REQUIRED>
 <!ELEMENT TimeGenerated (#PCDATA)>
 <!ELEMENT SourceName (#PCDATA)>
 <!ELEMENT EventID (#PCDATA)>
 <!ELEMENT Message (#PCDATA)>
 <!ELEMENT ROW (TimeGenerated, SourceName, EventID, Message)>
 <!ELEMENT ROOT (ROW*)>
]>
<ROOT DATE_CREATED="2004-11-08 16:26:54" CREATED_BY="Microsoft Log Parser V2.2">
 <ROW>
  <TimeGenerated>
  2004-04-18 18:48:04
  </TimeGenerated>
  <SourceName>
  EventLog
  </SourceName>
  <EventID>
  6009
  </EventID>
  <Message>
  Microsoft (R) Windows (R) 5.01. 2600 Service Pack 1 Uniprocessor Free. 
  </Message>
 </ROW>
 <ROW>
  <TimeGenerated>
  2004-04-18 18:48:04
  </TimeGenerated>
  <SourceName>
  EventLog
  </SourceName>
  <EventID>
  6005
  </EventID>
  <Message>
  The Event log service was started. 
  </Message>
 </ROW>
 <ROW>
  <TimeGenerated>
  2004-04-18 18:48:27
  </TimeGenerated>
  <SourceName>
  Service Control Manager
  </SourceName>
  <EventID>
  7035
  </EventID>
  <Message>
  The Network Connections service was successfully sent a start control. 
  </Message>
 </ROW>
</ROOT>

Document Structures
Into-Entity Syntax
Parameters
Examples


See also:

XML Input Format

© 2004 Microsoft Corporation. All rights reserved.