[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
Re: Javascript : from xsl to xml
Subject: Re: Javascript : from xsl to xml From: Jay Sachs <jay@xxxxxxxxxx> Date: Thu, 03 Aug 2000 16:04:10 -0400 |
Michel Guay wrote: > I would like to know how to make the method "WINDOW.OPEN" work with a > variable that would get the information which is stored in the IMAGE > element of my xml, so putting the image in the opening window. I will have > 340 different xml pages, one for each expression of the encyclopedia. [snip] > <ROOT> > <SEE_PICTURE> > <IMAGE href="../gifjpg/a/abydos01.jpg"></IMAGE> > </SEE_PICTURE> > </ROOT> > > 2. I have this Javascritp in my xsl : > > <script language="JavaScript"> > <![CDATA[function image(){ > window.open(' NOT YET DEFINED '); I'm not versed in Javascript, but I assume something like: function image(imgname) { window.open(imgname); } > } > ]]> > </script> [snip] > <xsl:template match="IMAGE"> > <a> > <xsl:attribute name="href"> > <xsl:value-of select="@href"/> > </xsl:attribute> > <button > name="image" > STYLE="BACKGROUND-COLOR: > #CECEA5;cursor:hand;width:50;height:25;text-align:absmiddle;" > onClick="image()"><img src="../../../a_icones/oeil2.jpg" width="50" > height="25"/> > </button> Here, I think you want to use an attribute value template to extract the href attribute on the image element: ... onClick="image('{@href}')" ... I don't know the HTML/Javscript enough to tell if this will actually work, but I assume your question is how to get a parameter into the image() invocation. > <xsl:apply-templates/> > </a> > </xsl:template> jay XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: Javascript : from xsl to xml, Jeni Tennison | Thread | RE: Javascript : from xsl to xml, Michel Guay |
RE: unable to reference a portion o, Chris Bayes | Date | Re: Arbitrary sorting, Jeni Tennison |
Month |