[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Expandeable Tree!
Adam J Knight wrote:
Hi all, First, the depth and parent attributes are not necessary because you have that information in the XML hierarchy. However all xsl processing is done server side (Using PHP 4 XSLT Processor). Default view is all level (depth) 0 nodes displayed. A user clicks a html link that sends the id of the node clicked to the xsl file as a parameter and all children nodes are displayed. If depth is greater than one, all ancestor nodes will need to be displayed also. You could do something like: <xsl:template match="/"> <ul class="nav"> <xsl:apply-templates/> </ul> </xsl:template> <xsl:template match="*"> <xsl:choose> <xsl:when test="child::*"> <li class="folder"> <a href="my.php?id={@id}"> <xsl:value-of select="@value"/> </a> <ul> <xsl:apply-templates/> </ul> </li> </xsl:when> <xsl:otherwise> <li class="page"> <a href="my.php?id={@id}"> <xsl:value-of select="@value"/> </a> </li> </xsl:otherwise> </xsl:choose> </xsl:template> best, -Rob
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|