473,545 Members | 1,977 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>AgentThr ee</VALUE><VALUE>De rekL</VALUE>
</ATTRIBUTE>

Using the folowing code only returns the fist VALUE of AgentThree
<td>
<xsl:for-each select="ATTRIBU TE">
<xsl:if test="@NAME='Us ers'">
<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: AgentThreeDerek L
<td>
<xsl:for-each select="ATTRIBU TE">
<xsl:if test="@NAME='Us ers'">
<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 1435
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
1483
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 DECLARE @PartA nvarchar(100), @PartB nvarchar(100)
3
1991
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 sums together I'm getting a ridiculously high number. Below is my SQL line that is trying to add together the colomns of qryDetlPALIncome and...
6
10946
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 array m int m23 = somefunction?(m,2,2) // m23 will hold srd and 4th items in array m , and &m01 = &m, &m23 = &m + 2, always, (& is the get address of...
12
2757
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 both the iis and sql server in a single machine. Not too long ago, the machine had some hardware problems, and management has decided to purchase new...
2
3781
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 directory,
5
2533
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 background thread off the pool. I stepped through the logic, and everything seems to go through fine when the control is initialized, and my main...
3
10584
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 web.config file (VS 2005, Framework 2.0), I can retrieve the values fine: <appSettings> <add key="fileInputFolder" value="C:\National City...
0
2617
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 required values would go. In this case, I'm not sure if I should put all the not required fields in one table or separate tables. Since any one of them...
116
5080
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 two fields, A and B, which together comprise the PK for the junction table. However, I just came across some code in which the person created a...
0
7410
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7437
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7773
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5984
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5343
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4960
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3466
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1901
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 we have to send another system
1
1025
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.