I came across this issue trying to change the ContentQuery web part’s orientation from vertical to horizontal. The issue was I needed to branch in the first template within the ContentQueryMain.xsl on the style of the web part. I noticed that the style is not available until OuterTemplate.CallItemTemplate when the for each loop goes through each data row. What I did to get around this was grab the first data row in the data set and set an xsl variable to the value of the style for the first row. The code I used is as follows:
The select for the Style variable selects the first row of the data as indicated by the [1]. If there is no data, then the style is empty.
This is kind of a hack, but a good way to figure out what web part is being processed at the beginning of the contentquerymain.xsl