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: access of a param


Hi Michael,
 This is my code... I want to the value of the param "anchordata" as a
argument to onclick event of the <tr> tag... its value is getting calculated
within the last template but I do not know how to access it outside ???

<?xml version='1.0'?>
<xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; >

<xsl:param name="start_point" select="1"/>
<xsl:param name="num_col" select="count(//Header)"/>	
<xsl:param name="row_offset" select="10"/>	
<xsl:param name="anchor" select="'abc'"/>	

<xsl:template match="/">

<html>
<head>
	<title>PickList</title>
</head>
<body>

	<table STYLE="font-family:Verdana, Arial; font-weight:normal;
font-size:9pt; background:#888888 border:1px solid #000000">
		<tr style="background-color:#E6EDF9; border-bottom:0.02cm
solid #663300; border-right:0.02cm solid white" HEIGHT='25'>
		<xsl:for-each select="//Header">
			<td STYLE="font:normal normal 8pt Verdana"><font
color="#990000"/><xsl:value-of select="ColHdr" /></td>
		</xsl:for-each> 
		</tr>

		<xsl:call-template name="dis_rows">
			<xsl:with-param name="num_nodes"
select="$start_point"/>
		</xsl:call-template>	

	</table> 
</body>
</html>
</xsl:template>

<xsl:template name="dis_rows">
<xsl:param name="num_nodes"/>	
	<xsl:if test="$num_nodes != $start_point + $row_offset">
	<tr STYLE="font:normal normal 9pt Verdana"
onmouseover="this.style.color='red';this.style.cursor='hand'"
onmouseout="this.style.color='black'">

		<xsl:call-template name="display_columns">
			<xsl:with-param name="col_num" select="1"/>
			<xsl:with-param name="row_num" select="$num_nodes"/>
			<xsl:with-param name="anchordata" select="''"/>
		</xsl:call-template>

	</tr>

		<xsl:call-template name="dis_rows">
			<xsl:with-param name="num_nodes" select="$num_nodes
+ 1"/>
		</xsl:call-template>
	</xsl:if> 
</xsl:template>

<xsl:template name="display_columns">
<xsl:param name="row_num"/>	
<xsl:param name="col_num"/>
<xsl:param name="anchordata"/>

	<xsl:choose>
    
        <xsl:when test="$col_num != $num_col + 1">

        <xsl:variable name="coldata"
select="//Data[position()=$row_num]/Columns[position()=$col_num]/Col"/>	
        <td>

		<xsl:if test="$row_num mod 2 != 0">
			 <xsl:attribute name="bgcolor"><xsl:value-of
select="'white'"/></xsl:attribute> 
		</xsl:if> 	
		<xsl:if test="$row_num mod 2 = 0">
			    <xsl:attribute name="bgcolor"><xsl:value-of
select="'#FFF5D7'"/></xsl:attribute> 
		</xsl:if> 	
		<xsl:value-of select="$coldata"/>	

	</td>

		<xsl:call-template name="display_columns">
			<xsl:with-param name="col_num" select="$col_num +
1"/>
			<xsl:with-param name="row_num" select="$row_num"/>
               		<xsl:with-param name="anchordata"
select="concat('|',$coldata)"/>
		</xsl:call-template>
    	</xsl:when> 
    </xsl:choose>

	<xsl:value-of select="$anchordata"/>
</xsl:template>
</xsl:stylesheet>


Regards,
aruniima

-----Original Message-----
From: Michael Kay [mailto:michael.h.kay@ntlworld.com]
Sent: Tuesday, August 06, 2002 9:46 PM
To: xsl-list@lists.mulberrytech.com
Subject: RE: [xsl] access of a param 

>  How can access the value of a parameter, which is within
> some template... I am using recursive call to templates to
> calculate a value. I want to access the value outside that
> template... how can I do so???

You can't solve your problem that way. Tell us what your problem is, and
we'll tell you the right way to solve it.

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
----------------------------------------------------------------------------

This message contains privileged and confidential information and is
intended only for the individual named. If you are not the intended
recepient you should not disseminate, distribute, store, print, copy or
deliver this message. Please notify the sender immediately by e-mail if you
have received this e-mail by mistake and immediately delete this e-mail from
your system.


E-mail transmission cannot be guaranteed to be secure or error-free as
information could be intercepted, corrupted, lost, destroyed, arrive late or
incomplete, or contain viruses. The sender therefore does not accept
liability for any errors or omissions in the contents of this message which
arise as a result of e-mail transmission.  If verification is required
please request a hard-copy version.


--------------------------------------------------------------------------

 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]