cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From George Pieri <george.pi...@wcom.com>
Subject RE: XML/XSLT to html including JavaScript question
Date Fri, 26 Jul 2002 13:11:32 GMT





Is your javascript function being called at all ?
If you hardcode a simple javascript helloworld function
with an alert('Hello') in it within the same xsl file will
you see the popup ?

I have gotten this to work using external files below is
a sample of my xls which will call a javascript function on
events for a table cell....

   <script language="javascript" src="resources/wcomView.js"></script>
   <TD>
             <xsl:attribute name="onmouseover"><xsl:value-of
select="//VIEW/EVENTS/@cellMouseOver"/></xsl:attribute>
             <xsl:attribute name="onmouseout"><xsl:value-of
select="//VIEW/EVENTS/@cellMouseOut"/></xsl:attribute>
             <xsl:attribute name="onclick"><xsl:value-of
select="//VIEW/EVENTS/@cellClick"/></xsl:attribute>


Good luck :>


-----Original Message-----
From: Jeanine Meyer [mailto:vze2s839@verizon.net]
Sent: Thursday, July 25, 2002 3:06 PM
To: george.pieri@wcom.com
Subject: XML/XSLT to html including JavaScript question


Hello,
(Forgive any redundancy with previous messages.)
I'm having problems with what I think is a simple task: recreating the
standard image swap in on mouse over.
I have other examples of xml citing xsl working using IE6 and also NS6.2.
However, in this example, the javascript function doesn't seem to be called.
Also, when I use saxon, a file is produced that works in NS6.2 but not
in IE6.
Here is the xml file:
<?xml version="1.0" ?>
<?xml-stylesheet href="mouseover2.xsl" type="text/xsl"?>

<pictures>
  <oimage>Liz-book.jpg</oimage>
  <nimage>Darcy3.jpg</nimage>
</pictures>
***************mouseover2.xsl
<?xml version="1.0" ?>
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html" />
<xsl:template match="/pictures">
<html>
<head>
<title> Rollover test </title>
<script language="JavaScript" type="text/javascript" src="movein.js">
</script>
</head>
<body>
<xsl:element name="a">
  <xsl:attribute name="href"></xsl:attribute>
  <xsl:attribute name="onMouseOver">movein('<xsl:value-of
select="nimage"/>');</xsl:attribute>
  <xsl:attribute name="onMouseOut">movein('<xsl:value-of
select="oimage"/>');</xsl:attribute>
  <xsl:attribute name="onClick">return false;</xsl:attribute>
  <xsl:element name="img">
    <xsl:attribute name="src"><xsl:value-of
select="oimage"/></xsl:attribute>
    <xsl:attribute name="id">picture1</xsl:attribute>
  </xsl:element>
</xsl:element>
</body>
</html>
</xsl:template>
</xsl:transform>
*************the result of using saxon
<html>
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

      <title> Rollover test </title><script language="JavaScript"
type="text/javascript" src="movein.js"></script></head>
   <body><a href="" onMouseOver="movein('Darcy3.jpg');"
onMouseOut="movein('Liz-book.jpg');" onClick="return false;"><img
src="Liz-book.jpg" id="picture1"></a></body>
</html>
************movein.js
function movein(image)
{
window.document.picture1.src=image;
}


I get the same results when I put in the function movein.js directly in
the mouseover.xsl (that is, when the resulting html doesn't use an external
javascript, but a local one).

HELP.
thanks,
Jeanine Meyer


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message