I have two lists, quizzes, and quiz questions in SharePoint. Quiz questions has a lookup column pointed to quizzes and includes a column for the originating list's row ID (quiz ID). I want to create a data viewer part with some custom XSLT and am just about finished but cannot get the final query to work quite correctly whereby I want to get all quiz questions for a quiz ID.
First I created a datasource in SPD and included both lists (linked). I then inserted a new Data View on my page and included the datasource. The hierarchy for my field looks correct in SPD:
/dsQueryResponse/QuizQuestions/Rows/Row/@Quiz_x003a_ID
In my XSLT, I have the filter written out something like this:
<xsl:variable name="Rows" select="/dsQueryResponse/QuizQuestions/Rows/Row[@Quiz_x003a_ID=10]"/>
10 in this case is just test data and I confirmed it is in the list. When I try this query, however, I get no results returned as evidenced by the following:
Count: <xsl:value-of select="count($Rows)"/>
If I take the filter out, I get every single row in the list. Now, there are two considerations which may or may not be related:
In SPD, whenever I look at the Current DataSource hierarchy, it does not show an integer value for this ID field (even though it does in the SP UI). Instead it shows as "
In a loop where I loop through the Rows values, , I can get and display a variable for the @Title field but cannot for the @Quiz_x003a_ID field. I get an unexpected error and correlation ID (and this is in SharePoint Online 2013) so I can't troubleshoot it further easily. This field clearly shows and I can copy the XPATH from SPD's hierarchy navigation the same.
Thanks in advance!
Try this, Im assuming you xml is similar to this:
And here is the XSL: