SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In short, sibling divs coded in my custom ItemStyle for use with a CQWP are being nested into each other.

Stripped down to the essential structure I have

<xsl:template name="AssetDocumentSubProcessDetails" match="Row[@Style='AssetDocumentSubProcessDetails']" mode="itemstyle">

    <div class="assetDocumentProcess">
        <div class="row1"></div>
        <div class="row2">
            <div class="col1"></div>
            <div class="col2"></div>


In use, this is rendering out like this

    <div class="assetDocumentProcess">
        <div class="row1">
            <div class="row2">
                <div class="col1">
                    <div class="col2">

And I'm dumbfounded. Why is SharePoint doing this?

share|improve this question
up vote 2 down vote accepted

This makes no sense to me but...

It appears that SharePoint XSLT for CQWP doesn't like empty elements. When I have an empty div it pulls the next element in the DOM into the parent of the empty element. My code had clearing divs at the end of the main containers so getting rid of those resolved the issue.

share|improve this answer
That's right, i've experienced the same issue in the past and it was also related with empty elements. – Vadim Gremyachev Aug 22 '14 at 11:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.