xsl-list
[Top] [All Lists]

Re: collapsable / expandable tree in XSL

2003-03-12 08:23:12
Hi,

I will soon install a command-line XSLT processor (xalan-java) and I thank 
Jarno for his hints.
I reformulate my problem (note that I use Mozilla and not I.E. msxml):

1) Here is a starting point where I use XSL to transform an XML file describing 
the content of a video (it could be anything else).

http://www.idiap.ch/~guillemo/VideoBrowser/XSLTsolution/videosegTEST.xml

2) Now, I want to make a dynamic page (still with XSL) with a simple 
collapsable / expandable tool (the idea in static html: 
http://www.idiap.ch/~guillemo/VideoBrowser/clip.html ).

A good solution I found is to include javascript such as:  
http://www.dansteinman.com/dynduo/en/collapsemenu.html  (simple example in 
collapsemenu1.html )

3) So far, I can't handle the same in XSL because of a <DIV> tag which does not 
finish (in the original HTML code, the author says that the javascript object 
will complete all the </div>'s on it's own ).

Thus, I have to find a way to create this element in the DOM: <div 
id="CollapseMenu0Block0"> without ending it.

I tried a lot of combinations but it still does not process the javascript:
i.e.
    <xsl:element name="div">
    <xsl:attribute name="id">CollapseMenu0Block1</xsl:attribute>
    </xsl:element>

Does anybody know a simple way to do a collapsable / expandable tree with XSL 
if this one cannot perform it? Using xerces parser function called by a CGI but 
it's a lot more code!! : )

Cheers,

Maël

---
http://www.idiap.ch/~guillemo/


Jarno(_dot_)Elovirta(_at_)nokia(_dot_)com wrote:

Hi,

One good thing is that it does not print it anymore. But it
still does not process it to render the collapsable /
expandable javascript tree.

ex:
http://www.idiap.ch/~guillemo/JAVASCRIPT/dynapi/docs/examples/
TEST2.xml with the sylesheet named Testdiv.xsl (in the same
directory).
while OK in html:
http://www.idiap.ch/~guillemo/JAVASCRIPT/dynapi/docs/examples/
collapsemenu1.html

Your stylesheet is a combination of a normal XSLT stylesheet and simplified 
syntax <http://www.w3.org/TR/xslt#result-element-stylesheet>, i.e. broken. 
Remove xsl:output and xsl:template instructions, they're not allowed in 
simplified syntax stylesheets.

You should install a command-line XSLT processor and try to run the 
transformation from the command-line, easier for development. When you get it 
to work on command-line, it (the transformation) will work on the browsers, 
too.

Cheers,

Jarno - SITD: Snuff Machinery (9mm RMX by A. Deal & T. Schmidt)

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>