0

I am attempting to make use of Microsoft's Log Parser 2.2. I am pointing my Log Parser at an XML file. I would like to obtain certain information from the XML file and then reuse this information within the query. I have created some pseudo code below:

GET UNIQUE *WINDOW_NAMES* 
FOR EACH *WINDOW_NAME*
{
 GET WINDOW_ATTRIBUTE_ONE;
 GET WINDOW_ATTRIBUTE_TWO;
}

Would this be possible with Log Parser 2.2?

An extract of the XML document:

<windows>
    <window>
        <name>
            Window One
        </name>
        <visible>
            Visible
        </visible>
        <stayontop>
            True
        </stayontop>
    </window>   
    <window>
        <name>
            Window Two
        </name>
        <visible>
            Visible
        </visible>
        <stayontop>
            False
        </stayontop>
    </window>   
    <window>
        <name>
            Window Three
        </name>
        <visible>
            Invisible
        </visible>
        <stayontop>
            True
        </stayontop>
    </window>
</windows>
JHarley1
  • 167
  • 1
  • 3
  • 9

2 Answers2

0

You might use the TPL output format to generate a (set of) queries based on the results of your first query, and then run logparser on the output file.

Gabriele Giuseppini
  • 1,541
  • 11
  • 19
0

SQL, in any form, and the LogParser variety especially, is not well-suited for looping. However, if all you're trying to do is get at the data elements, then this query might do the job:

LogParser -i:XML "file.xml#/windows/window"

This will output a table with the fields name, visible, and stayontop, and a row for each "window". You can then save/output this data using one of the LogParser output options (see LogParser -h or the LogParser Windows Help file for more details).

nateirvin
  • 1,173
  • 1
  • 10
  • 28