RE: Syntax for calling an XSL script function

Subject: RE: Syntax for calling an XSL script function
From: Jonathan Marsh <jmarsh@xxxxxxxxxxxxx>
Date: Tue, 19 May 1998 13:36:06 -0700
I assume you are using the Microsoft XSL ActiveX Control from within a web
page?  If so, this is a manifestation of an IE4 bug that prevents script
blocks from being created dynamically.  If you copy the <SCRIPT> block from
your XSL file into the HTML page that contains the control, I think you will
find that the script block can be found and executed.  If this workaround is
not adequate, perhaps the output of the XSL control can be sent to another
frame, or an IFRAME, so that the result is treated as an entire page and not
as a dynamically inserted block.

Hope this is helpful.

- Jonathan

		-----Original Message-----
		From:	Amit [mailto:Amitr@xxxxxxxxxxxxx]
		Sent:	Monday, May 18, 1998 7:37 AM
		To:	xsl-list@xxxxxxxxxxxxxxxx
		Subject:	Syntax for calling an XSL script function

		Hello All,

		I am not being able to call an XSL script (defined within
the XSL file)
		from within an XSL construction rule. IE4 throws a scripting
error at the
		point I make the script call.


		I'm including the code snippets to explain my problem :-

		I have one scripting function :-

		  <define-script><![CDATA[
		     function uniqueID(e) {
		      return tagName + formatNumberList(path(this), "1",
"_");
		    }
		  ]]></define-script>


		And I have another scripting function :-

		   <SCRIPT LANGUAGE="JSCRIPT"><![CDATA[
		          function hiLite(e) {
		            if (e.style.backgroundColor != 'yellow')
		              e.style.backgroundColor = 'yellow';
		            else
		              e.style.backgroundColor = 'white';
		          }
		    ]]></SCRIPT>

		And a construction rule:-

		  <rule>
		    <target-element type="item"/>
		    <DIV id='=uniqueID(this)'
		         onClick='="hiLite("+ uniqueID(this) + ")"'>
		      <children/>
		    </DIV>
		  </rule>

		Now, within the above construction rule I am calling  
		the hiLite() scripting function.

		But the hiLite() function does not get called when running
the XSL which
		embeds this code. IE4 throws a scripting error.!!!!

			Am I wrong in my syntax of calling the scripting
function?

			Thanx in advance,

								Regards,
								AMIT.
		 



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


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


Current Thread