Click to See Complete Forum and Search --> : Script functions


Mark Lawrence
05-06-2002, 06:34 PM
Hi all!

I have a problem at the moment that I'm trying to get around.

For the project I'm currently working on, I've had to come up with some "screen
mockups" in HTML, in order to demonstrate to the customer what the end product
will look like.

However, I'm now converting these to XSL that generates the HTML from XML
documents. I've got the presentation working fine, but I have some script
functions that are called from various events on the HTML screens, that won't
work with the XSL generated versions. I'm calling these by creating the appropriate
attribute (eg: onclick="function name") using <xsl:attribute> but when the
events fire I get a "type mismatch".

Can someone help me out with the correct way to call script functions in
this way?

Thanks
Mark

05-08-2002, 08:28 PM
Mark:

In my understanding the javascript on your xsl needs to be enclosed within
the CDATA, for example:

<script language="JavaScript">
<![CDATA[
function somefunction() {
...
...
}

function morefunction() {
... ...
}
]]>
</script>

Hope this would help.

AC


"Mark Lawrence" <mark.lawrence@eds.com> wrote:
>
>Hi all!
>
>I have a problem at the moment that I'm trying to get around.
>
>For the project I'm currently working on, I've had to come up with some
"screen
>mockups" in HTML, in order to demonstrate to the customer what the end product
>will look like.
>
>However, I'm now converting these to XSL that generates the HTML from XML
>documents. I've got the presentation working fine, but I have some script
>functions that are called from various events on the HTML screens, that
won't
>work with the XSL generated versions. I'm calling these by creating the
appropriate
>attribute (eg: onclick="function name") using <xsl:attribute> but when the
>events fire I get a "type mismatch".
>
>Can someone help me out with the correct way to call script functions in
>this way?
>
>Thanks
>Mark