p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

xslt thread: Despair compare


Message #1 by "kevin ritter" <kevin.ritter@j...> on Thu, 12 Jul 2001 11:41:05 -0500
Hi,

I saw two minor syntax errors in your XSL that might have been hampering 
your progress. Both of them are in the <xsl:choose> tag:

1.) <xsl:when test="$anid = '$quid'"> --> <xsl:when test="$anid = $quid">
2.) You forgot to close the <xsl:choose> tag itself.

With these two changes, it parses and I get this XML output:

QuestonIDs: q9876
AnswerIDs:  q9876

Have a match: q9876 = q9876
AnswerIDs:  q9877
AnswerIDs:  q9881
QuestonIDs: q9877
AnswerIDs:  q9876
AnswerIDs:  q9877

Have a match: q9877 = q9877
AnswerIDs:  q9881
QuestonIDs: q9881
AnswerIDs:  q9876
AnswerIDs:  q9877
AnswerIDs:  q9881

Have a match: q9881 = q9881

Original XSL snippet:
...
>     <xsl:choose>
>       <xsl:when test="$anid = '$quid'">
>         <xsl:text>
Have a match: </xsl:text>
>         <xsl:value-of select="$anid"/>
>         <xsl:text> = </xsl:text>
>         <xsl:value-of select="$quid"/>
>         <xsl:text>
</xsl:text>
>       </xsl:when>
>   </xsl:for-each>
...

  Return to Index