Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6368209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:38:46+00:00 2026-05-25T00:38:46+00:00

I’m developping a custom CQWP using a custom ContentQueryMain.xsl, I am using a list

  • 0

I’m developping a custom CQWP using a custom ContentQueryMain.xsl, I am using a list structure with which I would like to have a separator creating a new list each three items. Here is the code of the template:

<xsl:template name="CustomGroupTemplateSimple2">
    <ul>                    
        <li>
            <ul class="liste1">                             
            <xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row"/>  
            <xsl:for-each select="$Rows">
            <xsl:call-template name="OuterTemplate.CallPresenceStatusIconTemplate"/>            
                <li>
                    test                    
                </li>
                          <xsl:if test="position() mod 3 = 0">              
            </ul>                     
        </li>
        <li>                        
            <ul class="separator">
                          </xsl:if>                 
            </xsl:for-each>
            </ul>                   
        </li>               
    </ul>           
</xsl:template>

The separator is:

     </ul>                     
</li>                     
<li>                        
     <ul class="separator">

is responsible of the webpart error raised. The following code is working perfectly:

<xsl:template name="CustomGroupTemplateSimple2">
    <ul>                    
        <li>
            <ul class="liste1">                             
            <xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row"/>  
            <xsl:for-each select="$Rows">
            <xsl:call-template name="OuterTemplate.CallPresenceStatusIconTemplate"/>            
                <li>
                    test                    
                </li>
                          <xsl:if test="position() mod 3 = 0">                  
            SEPARATOR
                          </xsl:if>                 
            </xsl:for-each>
            </ul>                   
        </li>               
    </ul>           
</xsl:template>

And when I DIRECTLY replace the “SEPARATOR” with:

     </ul>                     
</li>                     
<li>                        
     <ul class="separator">

in the aspx page (after compilation), everything is perfectly working, too.

Therefore, I am really lost with this situation as I really need this separator.

Thank you very much

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T00:38:47+00:00Added an answer on May 25, 2026 at 12:38 am

    The reason for the error is obvious: Any XSLT stylesheet must be a well-formed XML document and this provided stylesheet isn’t. This is why even the XML parser that the XSLT processor uses to get its stylesheet module, raises a non-well-formedness exception.

    In particular, this fragment:

            <xsl:if test="position() mod 3 = 0">
                        </ul>
                       </li>
                       <li>
                 <ul class="separator">
            </xsl:if>
    

    isnt a well-formed XML fragment, becausethere isn’t any start tag for the end tags </ul> and </li>.

    Finally, here is a correct example of such positional grouping:

    <xsl:stylesheet version="1.0"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
     <xsl:output omit-xml-declaration="yes" indent="yes"/>
     <xsl:strip-space elements="*"/>
    
     <xsl:template match="node()|@*">
         <xsl:copy>
           <xsl:apply-templates select="node()|@*"/>
         </xsl:copy>
     </xsl:template>
    
     <xsl:template match="num[position() mod 3 = 1]">
      <group>
       <xsl:copy-of select=
        ". | following-sibling::*[not(position() > 2)]"/>
      </group>
     </xsl:template>
    
     <xsl:template match="num"/>
    </xsl:stylesheet>
    

    when this transformation is applied to the following XML document:

    <nums>
      <num>01</num>
      <num>02</num>
      <num>03</num>
      <num>04</num>
      <num>05</num>
      <num>06</num>
      <num>07</num>
      <num>08</num>
      <num>09</num>
      <num>10</num>
    </nums>
    

    the wanted, correctly grouped result is produced:

    <nums>
       <group>
          <num>01</num>
          <num>02</num>
          <num>03</num>
       </group>
       <group>
          <num>04</num>
          <num>05</num>
          <num>06</num>
       </group>
       <group>
          <num>07</num>
          <num>08</num>
          <num>09</num>
       </group>
       <group>
          <num>10</num>
       </group>
    </nums>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I would like to count the length of a string with PHP. The string
I have a text area in my form which accepts all possible characters from
I have thousands of HTML files to process using Groovy/Java and I need to
I have some data like this: 1 2 3 4 5 9 2 6
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.