i have an evaluation form filled in by a lot of users. i created an export in excel for this form. What i want to achieve is: the header of the excel will have all the questions and below every question the answers grouped by the user who filled in the form. For this, i'm getting the questions by evaluation form and order them by position, then i'm grouping the users who filled in the form, looping through the results of the grouping so i will have the same lines for every question. this is a part of the xml i'm generating:
<QUESTIONNAMES>
<ITEM>
<QUESID>468</QUESID>
<QUESNAME><![CDATA[Name]]></QUESNAME>
</ITEM>
<ITEM>
<QUESID>554</QUESID>
<QUESNAME><![CDATA[Palce]]></QUESNAME>
</ITEM>
</QUESTIONNAMES>
<EXPORTLINE>
<ITEMS>
<ITEM>
<QUESID>468</QUESID>
<VALUES>
<UserID>25151</UserID>
<VALUE><![CDATA[dommel]]></VALUE>
<UserID>45372</UserID>
<VALUE><![CDATA[Omnium]]></VALUE>
<UserID>54632</UserID>
<VALUE><![CDATA[Het Zand]]></VALUE>
<UserID>56604</UserID>
<VALUE><![CDATA[rijen]]></VALUE>
<UserID>57103</UserID>
<VALUE><![CDATA[Schanswiel]]></VALUE>
------
</VALUES>
</ITEM>
</ITEMS>
</EXPORTLINE>
<EXPORTLINE>
<ITEMS>
<ITEM>
<QUESID>554</QUESID>
<VALUES>
<UserID>22523</UserID>
<VALUE><![CDATA[test,test]]></VALUE>
<UserID>44308</UserID>
<VALUE><![CDATA[Ede]]></VALUE>
<UserID>47850</UserID>
<VALUE><![CDATA[Drachten]]></VALUE>
<UserID>50156</UserID>
<VALUE><![CDATA[Dalfsen]]></VALUE>
<UserID>50656</UserID>
<VALUE><![CDATA[Dongen]]></VALUE>
-----
</VALUES>
</ITEM>
</ITEMS>
</EXPORTLINE>
this is my xslt part:
<xsl:template name="enquteQuestions">
<tr>
<xsl:for-each select="QUESTIONNAMES/ITEM">
<td align="left"><xsl:value-of select="QUESNAME" /></td>
</xsl:for-each>
</tr>
<tr>
<xsl:for-each select="QUESTIONNAMES/ITEM">
<xsl:variable name="quesid" select="QUESID" />
<td align="left">
<xsl:for-each select="EXPORTLINE/ITEMS/ITEM[QUESID=$quesid]/VALUES/VALUE">
<xsl:sort select="VALUE"/>
<xsl:value-of disable-output-escaping="yes" select="." /><br />
</xsl:for-each>
</td>
</xsl:for-each>
</tr>
The problem is that: in the excel file, the answers are not matched, what i mean is that the answers of the second question do not match the answers of the first.
now i have:
Name |Place
--------------------------
dommel | test, test ----> i need to make sure that the answers of the second question match the answer of the first question.
let me know if it is not clear and if you have any suggestions to solve this.
thanks in advance.