|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Re: expandble list in XSL
1. Here, I would need a vector, something like: var exposed= new array(document.length); But then, I have to be able to get the number of a ceratin node, something like an inverse to the item(index) function. 2. If i write like this, obj.id get the value: <value-of> and of course that is not what I want. Thanks in advance XSL-file: -------------- <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<HTML>
<HEAD>
<SCRIPT>
var exposed=false; <---- 1.function show_details(obj) { if ( exposed == false ) // expand the list { obj.insertAdjacentHTML("BeforeEnd", document.all[obj.id+"details"].innerHTML); <---- 2. eval("exposed=true"); }
else // collapse the list
{
obj.children[0].outerHTML='';
eval("exposed=false");
}
}
</SCRIPT>
</HEAD>
<BODY>
<xsl:apply-templates select="//ITEM" />
<H1>Rubrik</H1>
<P>
<xsl:apply-templates select="//ITEM/NAME" />
</P>
</BODY>
</HTML>
</xsl:template><xsl:template match="ITEM/NAME"> |---2. <P ID="<xsl:value-of>" ONCLICK="show_details(this)"><B><xsl:value-of/></B></P> </xsl:template> <xsl:template match="ITEM" > |---2. <DIV ID="<xsl:value-of >details" STYLE="display: none"><UL> <LI><xsl:value-of select="DET1"/></LI><LI><xsl:value-of select="DET2"/></LI><LI><xsl:value-of select="DET3"/></LI></UL></DIV> </xsl:template> </xsl:stylesheet>
<?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="explist.xsl"?> <ITEMLIST> <ITEM> <NAME>item 1</NAME> <DET1>sf...</DET1> <DET2>..df.</DET2> <DET3>..asd.</DET3> </ITEM> .. ..more items </ITEMLIST> ______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|

Cart








