I am trying to retrieve the @AnswerCount Attribute
for the @QuestionID=1 AND the Answer element text =3
I successfully can pass the variables QuestionID and Answer but can't pull
out the
@AnswerCount
<QuestionResults>
<Question QuestionID="1">
<Answer AnswerCount="1">1</Answer>
<Answer AnswerCount="5">3</Answer>
<Answer AnswerCount="1">4</Answer>
<Answer AnswerCount="1">N/A</Answer>
</Question>
<Question QuestionID="2">
......
I was unsucessfully trying:
<xsl:variable name="choiceCount"
select="//QuestionResults/Question[@QuestionID=$qid][Answer=$matchText]/Answer/@AnswerCount"/>
<xsl:choose>
<xsl:when test="$choiceCount 0">
<xsl:value-of select="$choiceCount" />
</xsl:when>
<xsl:otherwise>-</xsl:otherwise>
</xsl:choose>
I always get 1 for the $choiceCount when the @QuestionID is found.