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: Including javascript functions in XSL Stylesheet


If you want to get something that looks like

<!--
a bunch of code
-->

 in the HTML output, try doing

&lt;!--
a bunch of code
--&gt;

Also, on the for loop, you should do

for(i = 0; i &lt; arrElmnts.length; i++)

Hope that helps . . .

Dave Halsted

----- Original Message -----
From: <prasadm@crt.com>
To: <xsl-list@mulberrytech.com>
Sent: Thursday, February 24, 2000 2:46 PM
Subject: Including javascript functions in XSL Stylesheet


> Hi guys,
>
> I have a xsl file which contains javascript function. This xsl file is
used
> to convert and xml string built dynamically to convert to HTML. The
> conversion
> goes through fine if there is no javascript function, but on the other
hand
> if the function
> is included it gives the error.
>
> "Attribute value should begin with a quote".
>
> One way of overcoming this problem is have the function in a javascript
file
> and include the file using <SCRIPT LANGUAGE="JavaScript"
> SRC="/../../common.js"></SCRIPT>
>
> But I want to know is there any other way of including the javscript in
the
> generated
> HTML file itself.
>
> The javascript function is as show below.
> I am using Oracle's Parser to achieve this.
>
> <!-- Java Script function
> function getIndex(thisForm, buttonLabel) {
>
> arrElmnts = thisForm.elements
>
> for(i = 0; i < arrElmnts.length; i++) {
>
> if( arrElmnts[i].value == buttonLabel ) {
> return i
> }
>
> }
>
> return -1
> }
> -->
>
> Thanks,
>
> Prasad M
> Home:- 630-595-0642
> Work:- 312-974-6543
> prasadm@crt.com <mailto:prasadm@crt.com>
>
>
>
>  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]