Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries [Thread Prev] >Thread Next - Re: Help Passing Param of string length and using it in a predicate He Help Passing Param of string length and using it in a predicate HeTo: NULL Date: 6/2/2006 2:50:00 AM
Hi All,
please bare with me I have been learning xls and xpath now for 5 days and
have not got to gripps with all the lingo yet :)
Bascially I have 2 templates one calling the other:
<xsl:for-each select="hea/Batch/Rec[not(listID =
preceding-sibling::Rec/listID)]">
<xsl:call-template name="Batch">
<xsl:with-param name="DataType" select="listID"/>
</xsl:call-template>
</xsl:for-each>
the above calls the template below:
<xsl:template name="Batch">
<xsl:param name="DataType"></xsl:param>
<table>
<tr>
<td colspan="2"><xsl:value-of select="$DataType"/></td>
</tr>
<tr>
<td>Daily report</td>
<td>Too Date Report</td>
</tr>
<tr>
<td>
<table width="100%" border="1" cellPadding="2" cellSpacing="0"
bordercolor="#333366" style="border-style=solid; border-width=1px;
border-color=black;">
<tr bgcolor="#00CCFF">
<th align="left">Outcome</th>
<th align="left">Description</th>
<th align="left">Freq</th>
<th align="left">%</th>
</tr>
<xsl:variable name="TFreq" select="sum(hea/Batch/Rec[sec='Daily' and
listID = String($DataType)]/Freq)"/>
<xsl:for-each select="hea/Batch/Rec[sec='Daily' and listID =
$DataType]">
<tr bgcolor="#CBFFA8">
<td><xsl:value-of select="Outcome"/></td>
<td><xsl:value-of select="Descript"/></td>
<td><xsl:value-of select="Freq"/></td>
<td><xsl:value-of select='format-number((Freq div $TFreq),
"00.##%")'/></td>
</tr>
</xsl:for-each>
<tr bgcolor="#00CCFF">
<td>Total</td>
<td> </td>
<td align="right" ><xsl:value-of select="$TFreq"/></td>
<td>100.00%</td>
</tr>
</table>
</td>
</tr>
</table>
</xsl:template>
Ok My problem is I am passing a param that is equal to the value of an
element ie CAP1.
I am then using this in the predicates is the form of <Element> = $Param.
$Param does work if its a literal string I am passing eg 'CAP1' but because
I am just passing CAP1 it does not work.
I have tried using concat to add the ' to the string before I pass it to the
param and using it after the param is asined in predicate but nothing I try
seams to work.
I am sure this is a simple problem to solve as to me this is an obvious use
of xsl.
please help I have googled my brains out with no luck
Thanks in advance Russ
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
