I have the following xsl that contains javascript. The * in the writeSideNav function is to be dynamically determined by a position() function for the system-folder and system-page templates. How can I "link" the value of the of position() functions to where the stars are located?
<xsl:template match="/">
<table border='0' cellspacing='0' cellpadding='0' width='100%'>
<xsl:apply-templates select="system-index-block" />
<script language="javascript">
pageLoc(); writeSideNav('*',*,*,*,pageStr);
</script>
</table>
</xsl:template>
<xsl:template match="system-index-block">
<xsl:apply-templates select="//system-folder[@current='true']| //system-page[@current='true']" />
</xsl:template>
<xsl:template match="name | path" />
<xsl:template match="system-folder" >
<xsl:variable name="folder-position">
<xsl:value-of select="position()"/>
</xsl:variable>
</xsl:template>
<xsl:template match="system-page" >
<xsl:variable name="folder-position">
<xsl:value-of select="position()"/>
</xsl:variable>
</xsl:template>
<xsl:template match="/">
<table border='0' cellspacing='0' cellpadding='0' width='100%'>
<xsl:apply-templates select="system-index-block" />
<script language="javascript">
pageLoc(); writeSideNav('*',*,*,*,pageStr);
</script>
</table>
</xsl:template>
<xsl:template match="system-index-block">
<xsl:apply-templates select="//system-folder[@current='true']| //system-page[@current='true']" />
</xsl:template>
<xsl:template match="name | path" />
<xsl:template match="system-folder" >
<xsl:variable name="folder-position">
<xsl:value-of select="position()"/>
</xsl:variable>
</xsl:template>
<xsl:template match="system-page" >
<xsl:variable name="folder-position">
<xsl:value-of select="position()"/>
</xsl:variable>
</xsl:template>