This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Javascript : from xsl to xml



	Michel,
	I originaly wondered what you were doing with <button. I should have
read the ie5 docs more closely. Although there is nothing Wrong with jeni's
reply I am sure that you will find that this will save you a lot of
headaches

<script language="JavaScript">
<![CDATA[function image(url){
         window.open(url);
}
]]>
</script>

<xsl:template match="IMAGE">
	<button  name="image"
STYLE="BACKGROUND-COLOR:#CECEA5;cursor:hand;width:50;height:25;text-align:ab
smiddle;" >
			<xsl:attribute name="onclick">
      			image('<xsl:value-of select="@href"/>');
			</xsl:attribute>
		<img src="../../../a_icones/oeil2.jpg" width="50"
height="25"/>
	</button>
	<xsl:apply-templates/>
</xsl:template>

This gives you the benefit of putting as many clickable images on a page as
you like. You can put them anywhere i.e.
<ROOT>
         <SEE_PICTURE>
                 <IMAGE href="../gifjpg/a/abydos01.jpg"></IMAGE>
         </SEE_PICTURE>
	   <para>
			<historicalNote>
         			<SEE_PICTURE>
                 			<IMAGE
href="../gifjpg/a/abydos01.jpg"></IMAGE>
        			</SEE_PICTURE>
			</historicalNote>
	  </para>
</ROOT>
Jeni's suggestion of putting them in an external file is deffinately the
best way to go for scripts as in
<HEAD>
	<TITLE>Some title</TITLE>
	<script language="JavaScript" src="showImage.js"></script>
</HEAD>
<BODY...................................
It will save you any problems with cdata sections. It also alows you to
debug your scripts if you have a debugger. Your method for opening a picture
in a window is in one place so it is easily changed to open a small window
with no bars etc on one line of code instead of many.

Ciao Chris
BTW Nice site.

> >-----Original Message-----
> >From: owner-xsl-list@mulberrytech.com
> >[mailto:owner-xsl-list@mulberrytech.com]On Behalf Of Michel Guay
> >Sent: 04 August 2000 08:51
> >To: xsl-list@mulberrytech.com
> >Subject: RE: Javascript : from xsl to xml
> >
> >
> >Many thanks to those of you who answered my question. Jeni's explaination
> >and suggestion did help solve my problem (and some others too).
> >
> >Since  the :
> >
> > ><script language="JavaScript">
> > > <![CDATA[
> > > function image() {
> > > window.open(']]><xsl:value-of
> > > select="/ROOT/SEE_PICTURE/IMAGE/@href" /><![CDATA[');
> > > }
> > > ]]>
> > ></script>
> >
> >concerned a <button> tag,  I have no difficulty planning other similar
> >function for other buttons if necessary.
> >
> >Bye,
> >
> >Michel
> >
> >http://www.egypteeternelle.net
> >Un site dédié à l'exploration et à l'étude de l'Égypte pharaonique.
> >Nouvelles, Bibliographie, Centre de doc., Babillard, Bibliographie
> >exhaustive.
> >
> >
> > XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]