Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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>
        </div>
    </div> 

</xsl:template>

In use, this is rendering out like this

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

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

share|improve this question

1 Answer 1

up vote 1 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 at 11:02

Your Answer

 
discard

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.