XML COM Input Format sample

This sample COM input format implements a reader of sample XML files.

The following steps need to be performed in order to use this input format:

  1. Compile the XMLInputFormat.cs file with the following command: (substitute the .NET Framework system assemblies path with the path on your computer)
    csc.exe /r:C:\winnt\Microsoft.NET\Framework\v1.0.3705\System.dll /r:C:\winnt\Microsoft.NET\Framework\v1.0.3705\System.Xml.dll /target:library XMLInputFormat.cs AssemblyInfo.cs

  2. Install the XMLInputFormat.dll assembly into the GAC using the following command:
    Gacutil.exe /i XMLInputFormat.dll

  3. Register the XMLInputFormat.dll assembly with the following command:
    Regasm.exe XMLInputFormat.dll

  4. To see the fields returned by this input format, execute the following Log Parser command:
    logparser -h -i:COM -iprogid:MSUtil.LogQuery.Sample.XMLInputFormat


  5. Execute the following Log Parser query to parse the books.xml file:
    logparser "SELECT * FROM books.xml" -i:COM -iprogid:MSUtil.LogQuery.Sample.XMLInputFormat
    The query returns:
    Author Price     PubDate
    ------ --------- ------------------
    Carson 31.950000 10/21/2001 0:00:00
    Smith  52.400000 3/10/2003 0:00:00
    Jones  53.970000 10/21/2001 0:00:00
    Barney 32.400000 5/23/2000 0:00:00
    Keller 98.820000 12/26/2001 0:00:00
    Doe    77.250000 3/10/2003 0:00:00
    Silver 10.990000 5/1/2001 0:00:00