       <xsl:variable name="expanded">         <xsl:choose>           <xsl:when test="$chapnum = $curchapnum">true</xsl:when>           <xsl:otherwise>false</xsl:otherwise>         </xsl:choose>       </xsl:variable>       <xsl:variable name="loadscrollpos">         <xsl:choose>           <xsl:when test="$chapnum = $curchapnum">loadscrollpos</xsl:when>           <xsl:otherwise>no</xsl:otherwise>         </xsl:choose>       </xsl:variable>       <