[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: collapsable / expandable tree in XSL

Subject: Re: collapsable / expandable tree in XSL
From: Mael Guillemot <Mael.Guillemot@xxxxxxxx>
Date: Wed, 12 Mar 2003 10:58:24 +0100
expandable tree
Hi,

Thanks Jarno and Tom for your respective help. OK, I forget about the d-o-e, I try your suggestion:

  <xsl:element name="div" namespace="http://www.w3.org/1999/xhtml">
    <xsl:attribute name="id">CollapseMenu0Block2</xsl:attribute>
  </xsl:element>

I also tried simply with (same way of coding than using <img> xsl element with the "src" attribute):

<div>  <xsl:attribute name="id">CollapseMenu0Block2</xsl:attribute> </div>

and even like the original HTML - Note that the problem is not as I thought in the ending tag </div> (which works fine in html) .

<div id="CollapseMenu0Block0"> </div>

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

Thanks for any ideas,

Maël

=====================================================
original Javascript/HTML source from:
http://www.dansteinman.com/dynduo/en/collapsemenu.html



Jarno.Elovirta@xxxxxxxxx wrote:

> Hi,
>
> > I went through the archive mails on "disable-output-escaping"
> > and the majority of posts deal with how to insert html
> > abreviations like &lt;,  &apos; instead of < , '. So I tried
> > different ways:
> >     =>  <xsl:text disable-output-escaping="yes"> <![CDATA[
> > <div id="CollapseMenu0Block2"> ]]>  </xsl:text> )
> >     =>  using <xsl:output method="text"/> or  <xsl:output
> > method="html"/> at the begining of the stylesheet
> >     =>  <processing-instruction name="html"> <![CDATA[ <div
> > id="CollapseMenu0Block2"> ]]> </processing-instruction>
> >
> > but the browser still prints the tag instead of generating an
> > node tree and processing it (simple ex.
> > http://www.idiap.ch/~guillemo/JAVASCRIPT/dynapi/docs/examples/
> > TEST.xml against
> > http://www.idiap.ch/~guillemo/JAVASCRIPT/dynapi/docs/examples/
> > collapsemenu1.html)
>
> I meant forget about d-o-e, they way it's being used in your stylesheet is Wrong, and the XSLT processor in the browser might not support d-o-e at all; instead of serializing the result tree into buffer and parsing that into a DOM, it most probably serializes the result tree directly into a DOM tree.
>
> Instead of trying to output a text string using
>
>   <xsl:text disable-output-escaping="yes"><![CDATA[<div id="CollapseMenu0Block2">]]></xsl:text>
>
> you want to generate a an element node with e.g.
>
>   <div id="CollapseMenu0Block2">
>
> or
>
>   <xsl:element name="id" namespace="http://www.w3.org/1999/xhtml">
>     <xsl:attribute name="id">CollapseMenu0Block2</xsl:attribute>
>   </xsl:element>
>
> You are not writing out text that looks like tags, like you would using e.g. JSP, but rather building a result tree of nodes, like you build a tree using DOM. If you want to parameterize the element or attribute names, use xsl:element and xsl:attribute to generate the element and attribute nodes, respectively. So just rethink the problem and come up with a solution that generates a *tree*, not text.
>
> Cheers,
>
> Jarno - VNV Nation: Kingdom (restoration)
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.