This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Javascript : from xsl to xml
- To: xsl-list at mulberrytech dot com
- Subject: Re: Javascript : from xsl to xml
- From: Jay Sachs <jay at avacet dot com>
- Date: Thu, 03 Aug 2000 16:04:10 -0400
- References: <4.3.2.7.0.20000803133645.00e4c390@nobel.si.uqam.ca>
- Reply-To: xsl-list at mulberrytech dot com
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