473,385 Members | 1,622 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

loop number and uppercase in xsl

f
Here is my xml,

<?xml version = "1.0"?>
<Customer>
<Order Name="Tennis" Quality="10" Time="10/03/03">
<Order Name="Tennis" Quality="1" Time="1/03/03">
<Order Name="Ball" Quality="100" Time="10/3/03">
<Order Name="Tennis" Quality="100" Time="20/03/03">
</Customer>

I'm using xsl
<xsl:for-each select="\Customer\Order">
...
</xsl:for-each>

I want to get something like:

order[0].Name="TENNIS";
order[0].Quality = 10;
order[0].time="10/03/03";

order[1].Name="TENNIS";
order[1].Quality = 100;
order[1].time="1/03/03";

order[2].Name="BALL";
order[2].Quality = 100;
order[2].time="10/3/03";

How can I get the loop number and change the Name to uppercase?
Thanks.

ff
Jul 20 '05 #1
1 1462

"f" <ff****@yahoo.com> wrote in message
news:8f**************************@posting.google.c om...
Here is my xml,

<?xml version = "1.0"?>
<Customer>
<Order Name="Tennis" Quality="10" Time="10/03/03">
<Order Name="Tennis" Quality="1" Time="1/03/03">
<Order Name="Ball" Quality="100" Time="10/3/03">
<Order Name="Tennis" Quality="100" Time="20/03/03">
</Customer>

I'm using xsl
<xsl:for-each select="\Customer\Order">
...
</xsl:for-each>

I want to get something like:

order[0].Name="TENNIS";
order[0].Quality = 10;
order[0].time="10/03/03";

order[1].Name="TENNIS";
order[1].Quality = 100;
order[1].time="1/03/03";

order[2].Name="BALL";
order[2].Quality = 100;
order[2].time="10/3/03";

How can I get the loop number and change the Name to uppercase?


Both are FAQs:

1. Use the position() function (in your case you have to subtract 1 from
what it returns)

2. Use the translate() function.

=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
by: Hallvard B Furuseth | last post by:
Has someone got a Python routine or module which converts Unicode strings to lowercase (or uppercase)? What I actually need to do is to compare a number of strings in a case-insensitive manner,...
8
by: Markus Dehmann | last post by:
My ios::uppercase (and others) seems not to work. #include <iostream> using namespace std; int main(){ int num = 45; cout.setf(ios::hex | ios::showbase | ios::uppercase); cout << "number " <<...
13
by: GRoll21 | last post by:
I know there is a function but I cannot seem to find it. There should be a way to uppercase a char right? Here is what I got. cout << "Enter title of a book for look up: "; cin >>...
1
by: Beffmans | last post by:
How can I turn the Uppercase mode on in my TextBoxes? ch B. *** Sent via Developersdex http://www.developersdex.com ***
3
by: vduber6er | last post by:
Lets say I have this structure: typedef struct numbers { double first = 0.0; double second = 0.0; double third = 0.0; } MYVALUES; and I initialize an array of MYVALUES like the following
6
by: uche | last post by:
This function that I have implemented gives me an infinite loop. I am trying to produce a hexdum program, however, this function is not functioning correctly.....Please help. void...
6
by: Mike Langworthy | last post by:
i can not seem to get this code to work. someone please help using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication1 { class Program {
7
by: Wojciech Gryc | last post by:
Hi, I'm currently using Python to deal with a fairly large text file (800 MB), which I know has about 85,000 lines of text. I can confirm this because (1) I built the file myself, and (2)...
4
by: Hrsoft | last post by:
I'm a newbie with asp.net I need to transform a user textbox to uppercase, when typing. Is this possible? I read about Ajax Maskedit, but it is only to certain formats, like dates, etc Thanks...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.