[Home] [By Thread] [By Date] [Recent Entries]
On 21/03/2014 15:28, Ihe Onwuka wrote:
You see an hour ago I wast quite content with my You shouldn't have been really as warnings about over-use of text() come up fairly often:-) last time though the comments were dismissed with This is why I don't like to post code, because all I really needed from this thread was confirmation that duplicate elimination only applied to node identity rather than content. Coming back to this thread:
You apply <xsl:template match="RentAmount/text() | MonthlyAmounts/text()">
<xsl:value-of select="format-number(.,if (xs:decimal(.) > 999.99)
then '$,000.00' else '$0.00')"/>
</xsl:template>to each text node so if you have <RentAmount>12<!--3-->4</RentAmount> There are two text nodes so you will get $12.00$4.00 If you had instead had <xsl:template match="RentAmount| MonthlyAmounts">
<xsl:copy>
<xsl:value-of select="format-number(.,if (xs:decimal(.) > 999.99)
then '$,000.00' else '$0.00')"/>
</xsl:copy>
</xsl:template>Then you would get <RentAmount>124.00</RentAmount> David ________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. ________________________________________________________________________
|

Cart



