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]
Other format: [Raw text]

RE: How to get value from JavaScript


Michael,

Thank you for your help.  Now I understand the javascript can't be run during the transformation.  I think I need to look into Xalan-Java for the solution.

Thank you,
Yan




> ----------
> From: 	Michael Kay[SMTP:michael.h.kay@ntlworld.com]
> Reply To: 	xsl-list@lists.mulberrytech.com
> Sent: 	Friday, October 04, 2002 10:13 AM
> To: 	xsl-list@lists.mulberrytech.com
> Subject: 	RE: [xsl] How to get value from JavaScript
> 
> > 
> > First, I tried to assign xslt variable using JavaScript:
> > ***************************  XSLT codes 
> > ************************* <xsl:stylesheet xmlns:xsl = 
> > "http://www.w3.org/1999/XSL/Transform";
> > 					 
> xmlns:js="javascript:code" version = "1.1" > 
> > 		
> > 	<xsl:output method = "html" /> 
> > 
> > 	<xsl:variable name="url">	
> > 		<script language="javascript">
> > 			var strID;
> > 			var intLen;
> > 			strID = window.document.location.toString();
> > 			intLen = strID.indexOf('livelink.exe/fetch');
> > 			strID = strID.substring(0, intLen);
> > 			document.write(strID);
> > 		</script>					
> > 		
> > 	</xsl:variable>
> > ***************************  XSLT codes *************************
> 
> There's nothing magic about a <script> element in XSLT. It's just a
> result element that goes into the output HTML file. It doesn't get
> executed.
> 
> If you want JavaScript executed during the transformation, use
> msxsl:script or other vendor-defined extensions.
> 
> Michael Kay
> Software AG
> home: Michael.H.Kay@ntlworld.com
> work: Michael.Kay@softwareag.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]