473,473 Members | 1,504 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

<xsl:for-each select test value

1 New Member
I haven't done much work with XSL translations before and i'm stuggling to apply some code to a list of items. The when code works if it is not a list but I think I need to replace the ITEMCOST with something else but i'm not sure what. can someone help.

I am using this code as the <xsl:value-of select="format-number does not work with teh translator I'm using.

I am basically trying to set the resulting value as two decimal places, for currency.

Expand|Select|Wrap|Line Numbers
  1. <xsl:for-each select="LIST_PAYMENTS/ITEMCOST">
  2. <xsl:apply-templates/>                       <xsl:choose>
  3.     <xsl:when test="substring-before(ITEMCOST,'.') ='' ">
  4.      <xsl:value-of select='ITEMCOST'/>00<br/>
  5.      </xsl:when>
  6.      <xsl:when test="string-length(substring-after(ITEMCOST, '.' )) =1 ">
  7.      <xsl:value-of select='ITEMCOST'/>0<br/>
  8.       </xsl:when>
  9.     <xsl:otherwise>
  10.     <xsl:value-of select='ITEMCOST'/><br/>
  11.       </xsl:otherwise>
  12. </xsl:choose>
  13. </xsl:for-each>
Sep 21 '06 #1
0 1952

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Robert Kattke | last post by:
I'm working with Tomcat and have all my XSL files in a dir under WEB-INF. I wanted to set up some variables in an XSL, then import it into others. However, without any path specified it (zalan)...
4
by: dwa | last post by:
Is it legal to use a parameter in a <template match> ? If I do the following: <xsl:template match="/ContentRoot/Content/Categories/Category"> ....everything works as expected. But if I...
3
by: Blaise Garant | last post by:
Hi I've made a stylesheet to transform my data into XSL-FO. This stylesheet used to work with MSXSL 4.0 but I've got some issues in ..NET. First, I changed removed all the "node-set()" function...
3
by: b0yce | last post by:
Hi Group, I think I have found a problem with the <xsl:element> when being transformed by the .NET xmlTransform class. When using XmlSpy for development and debugging, the <xsl:number>...
5
by: Luke Vogel | last post by:
Hi all, Probably a really basic question, but I cant find an answer ... I have an xml file of books something like: <product> <isbn>0-735-61374-5</isbn> <title>Microsoft Visual Basic Step By...
4
by: Jon | last post by:
Hi, I used XslCompiledTransform with the following Xsl file. The <xsl:text disable-output-escaping="yes"does not work when using XslCompiledTransform to do the trnasform (namely the output...
3
by: Andy Dingley | last post by:
>From a thread over in c.i.w.a.h "RFC: From XHTML to HTML via XSLT" http://groups.google.co.uk/group/comp.infosystems.www.authoring.html/msg/f112c230061ffe86 As is well-known, the XSLT HTML...
4
by: C.W.Holeman II | last post by:
I am using Firefox 2.0.0.3 on MSWindows. I have an XML file http://emle.sourceforge.net/emle020000/testb.xml which invokes an XSLT file http://emle.sourceforge.net/emle020000/testb.xsl <?xml...
8
by: Hoi Wong | last post by:
With the XSLT 1.0 engine that I was forced to use, I have to parse old XML scripts where the number (to be parsed and saved into $EPISODE_NUMBER_RAW) that I want to parse is written with a comma...
2
Dormilich
by: Dormilich | last post by:
Hi, my goal is to have a stylesheet, where I can change the encoding attribute of the <xsl:output> element (one shall have utf-8 and the other latin-1). is there any way to set this via a...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.