Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: XSL TREE LIKE STRUCTURE >Thread Next - Re: XSL TREE LIKE STRUCTURE Re: XSL TREE LIKE STRUCTURETo: NULL Date: 2/9/2005 4:51:00 AM Hi Joris, thanks for your help. What i am trying to achieve is basically and
expandeable / collapseable tree component. I am using PHP and processing the
XSL server side. Default view of the component is to display all root level
nodes.
The user then clicks a html link of a root level node which causes the page
to resubmit. A Query string is attached to the link and is passed to the xsl
stylesheet as a parameter. Using this parameter the childnodes and / or
ancestors of the node just clicked are displayed. Thus the varying levels of
the tree are displayed after successive html link clicks
I have implemented they information presented in the style sheet you provided,
however is only seems to be displaying the root level nodes.
An example of what i am trying to acheive can be found here:
http://www.15seconds.com/issue/010921.htm
I am not trying to get into all the presentation complexities as yet, just
the basic functionality.
I do appreciate your help!!!!
"Joris Gillis" wrote:
> Tempore 00:41:06, die Wednesday 09 February 2005 AD, hinc in foro {microsoft.public.xsl} scripsit AJ <AJ@d...>:
>
> > I don't particularly understand everything that is happening with the xpath
> > expression, but i will get there. One problem i face at the moment is that i
> > can't seem to output any of the attribute values ie: (@depth,@value). Any
> > thoughts why.
>
> Yes, my original code required some adaption to fit your needs.
>
> To get an output like this (when node 10 is 'selected'):
>
> <table class="" align="center">
> <tr>
> <td width="20" align="right"><a href="ww.some.org&node=7">+</a></td><td>Test</td>
> </tr>
> <tr>
> <td width="40" align="right"><a href="ww.some.org&node=9">+</a></td><td>Test Sub One</td>
> </tr>
> <tr>
> <td width="60" align="right"><a href="ww.some.org&node=10">+</a></td><td>Test Sub Two</td>
> </tr>
> </table>
>
> use this stylesheet:
> <xsl:stylesheet version="1.1"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>
> <xsl:param name="css"/>
> <xsl:param name="c_node" select="10"/>
> <xsl:param name="url">ww.some.org</xsl:param>
>
> <xsl:output method="html" indent="yes"/>
>
> <xsl:template match="/">
> <table class="{$css}" align="center">
> <xsl:apply-templates />
> </table>
> </xsl:template>
>
> <xsl:template match="tree//*">
> <tr>
> <td width="{(@depth + 1) * 20}" align="right">
> <a href="{$url}&node={@id}">+</a>
> </td>
> <td>
> <xsl:value-of select="@value"/>
> </td>
> </tr>
> <xsl:apply-templates select="*[descendant-or-self::*/@id=$c_node]"/>
> </xsl:template>
>
> </xsl:stylesheet>
>
>
> If the output file does not fulfill your expectations, please include a sample of how it should look like in your reply.
>
>
> regards,
> --
> Joris Gillis (http://www.ticalc.org/cgi-bin/acct-view.cgi?userid=38041)
> Fiat W3C in tenebris
>
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
