forskellige img på bladnoder og noder med underniveau
HejsaJeg vil godt kunne sætte noder med underniveauer til plus minus.gif og bladnoder til prik.gif?
<xsl:template match="Subject">
<xsl:param name="parentid"></xsl:param>
<div>
<xsl:attribute name="id">div<xsl:value-of select="$parentid"/>_<xsl:value-of select="Name/text()"/></xsl:attribute>
<xsl:apply-templates select="Name">
<xsl:with-param name="parentid"><xsl:value-of select="$parentid"/>_<xsl:value-of select="Name/text()"/></xsl:with-param>
</xsl:apply-templates>
<div class="hidden">
<xsl:attribute name="id">sub<xsl:value-of select="$parentid"/>_<xsl:value-of select="Name/text()"/></xsl:attribute>
<xsl:apply-templates select="Subject">
<xsl:with-param name="parentid"><xsl:value-of select="$parentid"/>_<xsl:value-of select="Name/text()"/></xsl:with-param>
</xsl:apply-templates>
</div>
</div>
</xsl:template>
<xsl:template match="Name">
<xsl:param name="parentid"></xsl:param>
<xsl:choose>
<xsl:when test="position()!=last()">
<img src="images/plus.gif" alt="">
<xsl:attribute name="id">img<xsl:value-of select="$parentid"/></xsl:attribute>
<xsl:attribute name="onclick">iconClick '<xsl:value-of select="$parentid"/>'</xsl:attribute>
</img>
</xsl:when>
<xsl:otherwise>
<img src="images/prik.gif" alt="">
<xsl:attribute name="id">imgTest</xsl:attribute>
</img>
</xsl:otherwise>
</xsl:choose>
<input>
<xsl:attribute name="type">checkbox</xsl:attribute>
<xsl:attribute name="id">chk<xsl:value-of select="$parentid"/></xsl:attribute>
<xsl:attribute name="value">1</xsl:attribute>
<xsl:if test="Value=1">
<xsl:attribute name="checked">1</xsl:attribute>
</xsl:if>
</input>
<xsl:value-of select="text()" disable-output-escaping="yes"/>
</xsl:template>
</xsl:stylesheet>
<Taksonomi>
<Subject>
<Name>Brancher</Name>
<Subject>
<Name>Energi</Name>
</Subject>
<Subject>
<Name>Handel</Name>
</Subject>...