...

View Full Version : itereate REF name



ynotlim
03-04-2009, 09:50 PM
hello...

I'm trying to iterate through the ref name. So it would be "tree1, tree2, tree3" etc.



<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/system-index-block">
<ul class="treeview" id="treemenu1">
<xsl:apply-templates select="system-page | system-folder | system-symlink">
<xsl:sort select="order"/>
</xsl:apply-templates>
</ul>
</xsl:template>

<xsl:template match="system-folder">
<li>
<a>
<xsl:attribute name="href">
<xsl:attribute name="ref">$tree</xsl:attribute>
$tree++
<xsl:choose>
<xsl:when test="system-page[name = 'index']">
<xsl:value-of select="system-page[name = 'index']/path"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="system-page[1]/path"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:apply-templates mode="getname" select="."/>
</a>



</li>
</xsl:template>

<xsl:template match="system-page | system-symlink">
<li>
<a>
<xsl:attribute name="href">
<xsl:value-of select="path"/>
</xsl:attribute>
<xsl:apply-templates mode="getname" select="."/>
</a>
</li>
</xsl:template>

<xsl:template match="system-folder | system-page | system-symlink" mode="getname">
<xsl:choose>
<xsl:when test="display-name">
<xsl:value-of select="display-name"/>
</xsl:when>
<xsl:when test="title">
<xsl:value-of select="title"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="name"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

</xsl:stylesheet>

oesxyl
03-05-2009, 03:35 AM
from where did you get $tree and what is $tree++ ?

best regards



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum