Geert Verhaag wrote:
Dear Lenya'rs,

I'm struggling with calling an external Javascript from within the
xhtml2xhtml.xsl file.

The following is a new match I've added to it:
  <xsl:template match="xhtml:[EMAIL PROTECTED] = 'abstract']">
    <p>
     <script language="javascript" type="text/javascript"
src="myscript.js"/>
     <a href="javascript:myscript(myargument);">Abstract</a></p>
  </xsl:template>

I'd like to actually run the script when clicking the Abstract link on
the final html page.

At what location has the script to reside within the directory of my
publication?

which lenya version are you using again?
iirc, for 1.2 you should move the script to $YOURPUB/resources/shared/javascript/myscript.js, and then you can include it in the xsl as <script language="javascript" type="text/javascript" src="$root/javascript/myscript.js"/>
(i may be wrong, though. lenya 1.2 specialists might care to elaborate.)

a quick way to test it is to try a number of different URLs in the address bar of your browser before changing the XSLT - anything that works there will work in your XSLT.


--
Jörn Nettingsmeier

"One of my most productive days was throwing away 1000 lines of code."
  - Ken Thompson.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to