Subject: [xsl] Re:pass value between xml and javascript From: "Yang" <sfyang@xxxxxxxxxxxxx> Date: Mon, 10 Sep 2001 12:04:12 +0800 |
Chen; Gethering the suggestions from Max Dunn, Jeni, Ciao and your posts , I put a tested xslt with msxml3 for your reference. Also I simplify your attribute element using AVT(attribute value template) which a highly recommended exercise in this list. Cheers, Sun-fu Yang sfyang@xxxxxxxxxxxxx <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="html" indent="yes"/> <xsl:template match="/"> <head> <script language="javascript"> function WM_toggle(id){ if (document.all){ if(document.all[id].style.display == 'none'){ document.all[id].style.display = 'block'; } else { document.all[id].style.display = 'none'; } } else if (document.getElementById){ if(document.getElementById(id).style.display == 'none'){ document.getElementById(id).style.display = 'block'; } else { document.getElementById(id).style.display = 'none'; } } } </script> </head> <body> <p> <!--menu part--> <xsl:for-each select="placetogo/urbanspace"> <a href="#" onclick="WM_toggle('{cityid}'); return false"><xsl:value-of select="placename"/></a> <br /> </xsl:for-each> </p> ... <!--content part--> <xsl:for-each select="placetogo/urbanspace"> <p align="center" class="main" style="display: none" id="{cityid}"> <xsl:value-of select="placename"/> <br /> <img src="{photo/@img}"/><br /> <xsl:value-of select="country"/> <xsl:value-of select="description"/> <xsl:value-of select="continent"/> </p> </xsl:for-each> </body> </xsl:template> </xsl:stylesheet> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] pass value between xml an, Jennifer Hochgesang | Thread | [xsl] Re: Re:XSL for element contai, Yang |
RE: [xsl] pass value between xml an, Chen Wang | Date | [xsl] RE: XPath 2.0: Collection-Val, Dimitre Novatchev |
Month |