ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> exslt
exslt
[exslt] XSLT and JavaScript Interface Problem
by Cathy T CIV NSWCCD W. Bethesda other posts by this author
Jun 4 2007 12:19PM messages near this date
Re: [exslt] Compiled Transformation Function Library | Re: [exslt] XSLT and JavaScript Interface Problem
& XSLT Hi all,

I would like to use a returned value from JavaScript function in order
to input to a call-template. The compiler can not understand the
JavaScript function. I knew that I was missing something in my codes but
I could not figure out. Please help me to fix my code. Thanks in
advanced.  Cathy

 
The following is my sample:

<?xml version="1.0" encoding="UTF-8"?> 
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > 
<xsl:output version="1.0" encoding="utf-8" omit-xml-declaration="yes"
indent="no" media-type="text/html" /> 
	<xsl:template match="/"> 
		<HTML> 
  		<HEAD> 
			<script type="text/javascript"> 
				function getInstance(string)
				{
					instance =
string.substr(string.lastIndexOf(" "));
					return instance
				}
			</script> 
  		</HEAD> 

		<BODY> 
			<TABLE border="1" bgColor="#FFFFCC"> 
	
<TH> Group</TH><TH>Name</TH><TH>Value</TH><TH>Units</TH>
			<xsl:for-each
select="//ReportObject[@mmId='381911A60306']"> 
				<TR> 
					<xsl:variable
name="descriptiveName" select="ObjectInfo/DescriptiveName" /> 
					<script type="text/javascript"> 
						<xsl:variable
name="instanceId" select="getInstance('$descriptiveName')" /> 
					</script> 

					<xsl:call-template
name="ID38186530022D" > 
						<xsl:with-param
name="curInstance" select="$instanceId" /> 
					</xsl:call-template> 
				</TR> 
			</xsl:for-each> 
			</TABLE> 
		</BODY> 
		</HTML> 
	</xsl:template> 

	<xsl:template name="ID38186530022D" > 
		<xsl:param name="curInstance" /> 
		<xsl:for-each
select="../ReportObject[@mmId='38186530022D']/PropertyData/Vector[Value[
1] = $curInstance]" > 
			<TD> <xsl:value-of select="$curInstance" /></TD>
			<TD> <xsl:value-of select="Value[2]" /></TD>
		</xsl:for-each> 
	</xsl:template> 	

</xsl:stylesheet> 
Thread:
Cathy T CIV NSWCCD W. Bethesda
Mike Brown
Cathy T CIV NSWCCD W. Bethesda
Cathy T CIV NSWCCD W. Bethesda

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved