Grouping Records
Hello All -
I have been reading the posts here, along with various books and articles, but have not found a solution to this problem. I have an XML data file created as the results log of a conversion utility. The XML appears to me to be poorly structured, as shown in this example:
<logMsg msgID="TRANSFORMINGREPORT" comp="S7" severity="info" sect="msg">
<time>2005-09-20 15:31:38</time>
<param name="INDEXPOSITION">30</param>
<param name="INDEXTOTAL">235</param>
<param name="REPORTNAME">Inventory Report 1</param>
<text>Transforming report 30 of 235: Inventory Report 1</text>
</logMsg>
<logMsg comp="S7" sect="msg" msgID="STANDALONETEXTFRAME" severity="warning">
<param name="FRAMEIDENT" index="1">Team Name</param>
<param name="BLOCKID" index="2">_451</param>
<text>Warning! The following text frame was migrated as a block element: Team Name. The block element ID is: _451. You may not get data rendered inside this object.</text>
</logMsg>
<logMsg comp="S7" sect="msg" msgID="STANDALONETEXTFRAME" severity="warning">
<param name="FRAMEIDENT" index="1">Counts of appID</param>
<param name="BLOCKID" index="2">_471</param>
<text>Warning! The following text frame was migrated as a block element: Counts of appID. The block element ID is: _471. You may not get data rendered inside this object.</text>
</logMsg>
<logMsg msgID="TRANSFORMINGREPORT" comp="S7" severity="info" sect="msg">
<time>2005-09-20 15:31:40</time>
<param name="INDEXPOSITION">31</param>
<param name="INDEXTOTAL">235</param>
<param name="REPORTNAME">Inventory Report 2</param>
<text>Transforming report 31 of 235: Inventory Report 2</text>
</logMsg>
<logMsg comp="S7" sect="msg" msgID="STANDALONETEXTFRAME" severity="warning">
<param name="FRAMEIDENT" index="1">Team Name</param>
<param name="BLOCKID" index="2">_306</param>
<text>Warning! The following text frame was migrated as a block element: Team Name. The block element ID is: _306. You may not get data rendered inside this object.</text>
</logMsg>
<logMsg comp="S7" sect="msg" msgID="STANDALONETEXTFRAME" severity="warning">
<param name="FRAMEIDENT" index="1">Counts of appID</param>
<param name="BLOCKID" index="2">_290</param>
<text>Warning! The following text frame was migrated as a block element: Counts of appID. The block element ID is: _290. You may not get data rendered inside this object.</text>
</logMsg>
Every "record" written to the log file is tagged as a 'logMsg', and as you can see the 'msgID' really indicates what the relations are among the repeated sub-records showing each error found in the conversion. I need to format this into something human-readable showing a report and all errors found in that report, and then the next report and all it's errors, etc. I'm finding it hard to code an XSLT that needs to test attribute values and loop through these sub-records.
Any suggestions would be greatly appreciated.
Regards,
Opher
|