This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: how to append a "," to the end of number
- From: Wendell Piez <wapiez at mulberrytech dot com>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Mon, 26 Aug 2002 18:46:15 -0400
- Subject: Re: [xsl] how to append a "," to the end of number
- Reply-to: xsl-list at lists dot mulberrytech dot com
Mac,
A simple value-of won't do it for you, since it returns only the value of
the first node in a node-set, so if you have more than one occurrence of
NightlyRates you'd lose all but the first. But something like this will:
<input type="hidden" name="NightlyRates">
<xsl:attribute name="value">
<xsl:for-each select="NightlyRates">
<xsl:if test="position() > 1">
<xsl:text>, </xsl:text>
</xsl:if>
<xsl:value-of select=".">
</xsl:for-each>
</xsl:attribute>
</input>
If this doesn't answer your question, could you clarify what you mean by
"NightlyRates will have 1-M occurrences" (maybe showing us a sample source
file).
And someone else will answer (since I'm going home :-).
Cheers,
Wendell
At 06:02 PM 8/26/2002, you wrote:
I have this problem, I have an unknown number of prices that will be
separated with a comma. I need to know if it is possible to do this in
my xsl.
<input type="hidden" name="NightlyRates">
<xsl:attribute name="value"><xsl:value-of
select="NightlyRates"/></xsl:attribute>
</input>
This is my problem here. NightlyRates will have 1-M occurrences and it
needs to be formatted like this. 54.95, 65.95 and so on.
======================================================================
Wendell Piez mailto:wapiez@mulberrytech.com
Mulberry Technologies, Inc. http://www.mulberrytech.com
17 West Jefferson Street Direct Phone: 301/315-9635
Suite 207 Phone: 301/315-9631
Rockville, MD 20850 Fax: 301/315-8285
----------------------------------------------------------------------
Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list