473,503 Members | 11,508 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to separate values

2 New Member
All,

I'm brand new to XSL and have no programming background.

I try to separate in an HTML output the values returned from an XML file.

The entry containing the data looks like this:

<ATTRIBUTE NAME="Users">
<VALUE>AgentThree</VALUE><VALUE>DerekL</VALUE>
</ATTRIBUTE>

Using the folowing code only returns the fist VALUE of AgentThree
<td>
<xsl:for-each select="ATTRIBUTE">
<xsl:if test="@NAME='Users'">
<xsl:value-of select="VALUE"/>
</xsl:if>
</xsl:for-each>
</td>

Using below code returns all values but no separation between them, so the output is like this: AgentThreeDerekL
<td>
<xsl:for-each select="ATTRIBUTE">
<xsl:if test="@NAME='Users'">
<xsl:value-of select="."/>
</xsl:if>
</xsl:for-each>
</td>


What I try to get is AgentThree DerekL or even better AgentThree, DerekL

Any help is highly appriciated.

Kind regards,
~RR
Nov 10 '06 #1
1 1429
Lowlander
2 New Member
I am using this now to separate the values and it works great.

<xsl:template name="comma-separated-list">
<xsl:param name="list"/>
<xsl:value-of select="$list[1]"/>
<xsl:for-each select="$list[position() > 1]">
<xsl:choose>
<xsl:when test="last() > position()">
<!-- When it is not the last value separate it with a semicolon -->
<xsl:text>;</xsl:text>
</xsl:when>
<!-- When it is the last value separate it with and -->
<xsl:otherwise><xsl:text> and </xsl:text></xsl:otherwise>
</xsl:choose>
<xsl:value-of select="."/>
</xsl:for-each>
</xsl:template>

However, how can I put each value in a separate data field of a table?
Apparently </td><td> on the position of the ; doesn't work.

Any sugestions?
Nov 17 '06 #2

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

Similar topics

14
1473
by: laurenq uantrell | last post by:
I want a user to be able to search for names in a table of clients using a single parameter, but be eable to use "and" or "or" IN the parameter. Like this: @NameSearch nvarchar(100) AS ...
3
1990
by: Richard Coutts | last post by:
I have two queries each of which having a column that I want to sum, and then add the two sums together. When I sum one query or the other, I get reasonable numbers. But when I try to add the two...
6
10942
by: Yanhao Zhu | last post by:
Hi, all, If I have an array like int m = new int { 0, 1, 2, 3 }, is there a way I can separate the array into two, like int m01 = somefunction?(m,0,2) // m01 will hold 1st and 2nd items in...
12
2753
by: Ann Marinas | last post by:
Hi all, I would like to ask for some help regarding separating the asp.net webserver and the sql server. I have created an asp.net application for a certain company. Initially, we installed...
2
3778
by: Christian Stooker | last post by:
Part one: ====== Hi ! I want to use SQLite database like the FireBird database: with big isolation level. What's that meaning ? I have an application that periodically check some input...
5
2531
by: RWF | last post by:
I have a form, and from the form when a user clicks a button, it instantiates control that will be doing a lot of logic. I am trying to use System.Threading.ThreadPool.QueueUserWorkItem to spawn a...
3
10580
by: Blasting Cap | last post by:
I am working on a web app that I want to be able to use a separate config file on, in addition to the web.config file that's already working in the application. If I put the following in the...
0
2612
by: Pasquale | last post by:
I have a form with 8 fields, 4 of which are required and 4 are not. Usually if a field isn't required I would create a separate table for it rather than having a blank value in the table where...
116
5062
by: Neil | last post by:
Whenever I've created junction tables in the past, I always made the PK of the junction table the combined pks from the two other tables. Ex: Table1 PK=A; Table2 PK=B; Junction table consists of...
0
7212
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,...
1
7017
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
7470
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
5604
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,...
1
5026
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3186
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
3174
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1524
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
405
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.