Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: Summarizing a total when needing individual calcuations first >Thread Next - Re: Summarizing a total when needing individual calcuations first Re: Summarizing a total when needing individual calcuations firstTo: NULL Date: 2/3/2006 6:47:00 PM
Kindler Chase wrote:
> As a follow up, I need to use the template you created to convert several
> variants of the "price" node. Is there a way assign a variable node instead
> of just using "price"?
> <xsl:call-template name="sumOrders">
> <xsl:with-param name="orders" select="root/order" />
> <xsl:with-param name="nodeToConvert" select="rebate" />
One way could be to pass in the element name as a string e.g.
<xsl:with-param name="element-name" select="'rebate'" />
> </xsl:call-template>
> </xsl:template>
>
> <xsl:template name="sumOrders">
> <xsl:param name="orders" />
> <xsl:param name="nodeToConvert" />
<xsl:param name="element-name">
(or if you want to set a default then e.g.
<xsl:param name="element-name" select="'price'" />
)
> <xsl:with-param name="orders" select="$orders[position() > 1]"
> />
> <xsl:with-param name="nodeToConvert" select="$nodeToConvert" />
<xsl:with-param name="element-name" select="$element-name" />
<xsl:with-param name="currentSum"
select="$currentSum + $orders[1]/*[local-name() = $element-name]
div $orders[1]/conversion_rate" />
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
