2

I'm Newbie in Sharepoint 2010 ,and I had to deal with ContentQueryMain.xsl which I hardly understand what going on there and what part goes where . I need to group result by Category , then sort them by category and quetion . I succeed doing that with a blank XSL and muenchian grouping ,but on CQWP I getting just one instance of a group . This is my XML:

<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="XslFaq.xslt"?>

<dsQueryResponse>
<Rows>
  <Rows
      Row="שאלה נפוצה שאלה נפוצהשאלה נפוצהשאלה נפוצהשאלה נפוצהשאלה נפוצה?"
      answer="כלשהי תשובה כלשהי תשובה כלשהי תשובה כלשהיתשובה כלשהיתשובה כלשהי תשובה כלשהי תשובה כלשהי תשובה כלשהי"
      ExtraInfo=""
      Download=""
      Category="קטגוריה1"
      FreqRow="1"
    />

  <Rows
       Row="שאלה נפוצה שאלה נפוצהשאלה נפוצהשאלה נפוצהשאלה נפוצהשאלה נפוצה?"
       answer="כלשהי תשובה כלשהי תשובה כלשהי תשובה כלשהיתשובה כלשהיתשובה כלשהי תשובה כלשהי תשובה כלשהי תשובה כלשהי"
       ExtraInfo="http://www.w3schools.com"
       Download=""
       Category="קטגוריה1"
       FreqRow="1"
    />

  <Rows
      Row="שאלה נפוצה שאלה נפוצהשאלה נפוצהשאלה נפוצהשאלה נפוצהשאלה נפוצה?"
      answer="כלשהי תשובה כלשהי תשובה כלשהי תשובה כלשהיתשובה כלשהיתשובה כלשהי תשובה כלשהי תשובה כלשהי תשובה כלשהי"
      ExtraInfo="http://www.microsoft.com"
      Download="http://www.mekusharim.co.il"
      Category="קטגוריה1"
      FreqRow="0"
    />

  <Rows
     Row="שאלה נפוצה שאלה נפוצהשאלה נפוצהשאלה נפוצהשאלה נפוצהשאלה נפוצה?"
     answer="כלשהי תשובה כלשהי תשובה כלשהי תשובה כלשהיתשובה כלשהיתשובה כלשהי תשובה כלשהי תשובה כלשהי תשובה כלשהי"
     ExtraInfo="http://www.walla.co.il"
     Download=""
     Category="עוד קטגוריה"
     FreqRow="1"
    />

  <Rows
         Row="שאלה נפוצה שאלה נפוצהשאלה נפוצהשאלה נפוצהשאלה נפוצהשאלה נפוצה?"
         answer="כלשהי תשובה כלשהי תשובה כלשהי תשובה כלשהיתשובה כלשהיתשובה כלשהי תשובה כלשהי תשובה כלשהי תשובה כלשהי"
         ExtraInfo="http://www.jquery.com"
         Download=""
         Category="עוד קטגוריה"
         FreqRow="0"
    />
  <Rows
        Row="שאלה נפוצה שאלה נפוצהשאלה נפוצהשאלה נפוצהשאלה נפוצהשאלה נפוצה?"
        answer="כלשהי תשובה כלשהי תשובה כלשהי תשובה כלשהיתשובה כלשהיתשובה כלשהי תשובה כלשהי תשובה כלשהי תשובה כלשהי"
        ExtraInfo="http://www.jquery.com"
        Download="http://www.beatles.com"
        Category="עוד קטגוריה"
        FreqRow="1"
    />
  <Rows
        Row="שאלה נפוצה שאלה נפוצהשאלה נפוצהשאלה נפוצהשאלה נפוצהשאלה נפוצה?"
        answer="כלשהי תשובה כלשהי תשובה כלשהי תשובה כלשהיתשובה כלשהיתשובה כלשהי תשובה כלשהי תשובה כלשהי תשובה כלשהי"
        ExtraInfo="http://www.jquery.com"
        Download=""
        Category="יש עוד"
        FreqRow="1"
    />
  <Rows
          Row="שאלה נפוצה שאלה נפוצהשאלה נפוצהשאלה נפוצהשאלה נפוצהשאלה נפוצה?"
          answer="כלשהי תשובה כלשהי תשובה כלשהי תשובה כלשהיתשובה כלשהיתשובה כלשהי תשובה כלשהי תשובה כלשהי תשובה כלשהי"
          ExtraInfo="http://www.jquery.com"
          Download="http://www.pais.co.il"
          Category="אהקטגוריה"
          FreqRow="1"
    />
  <Rows
         Row="שאלה נפוצה שאלה נפוצהשאלה נפוצהשאלה נפוצהשאלה נפוצהשאלה נפוצה?"
         answer="כלשהי תשובה כלשהי תשובה כלשהי תשובה כלשהיתשובה כלשהיתשובה כלשהי תשובה כלשהי תשובה כלשהי תשובה כלשהי"
         ExtraInfo="http://www.3school.com"
         Download="http://www.adleron.site.co.il"
         Category="אהקטגוריה"
         FreqRow="0"
          />
<Rows>
</dsQueryResponse>
Flynn1179
  • 11,925
  • 6
  • 38
  • 74
Adleron
  • 83
  • 9
  • So, What is the question? I don't see one. Also, please, provide the exact wanted result, the result your transformation produces and what is wrong with that produced result. People, who are experts in XSLT typically know nothing aboutSP. What is CQWP? – Dimitre Novatchev Dec 15 '12 at 15:15
  • CQWP -content query webpart I'm getting just one result of a category - If I have more quetion for same category , it will not display it . – Adleron Dec 15 '12 at 19:03
  • the problem solved , tommorow gonna upload my solution – Adleron Dec 18 '12 at 19:02
  • @Adleron - Tomorrow?... – banana Oct 17 '13 at 08:55

1 Answers1

0

I'm getting just one result of a category - If I have more questions for the same category, it will not display it

Use the following process:

  • Create an xsl:key
  • Set the following attributes: match="Rows" use="Category"
  • Reference the match in a loop, such as `xsl:for-each select="Rows"
  • Reference the key in a nested loop, such as xsl:for-each select="key('groupByRow', Category)"

References

Paul Sweatte
  • 24,148
  • 7
  • 127
  • 265