473,321 Members | 1,916 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,321 software developers and data experts.

workaround for reassign values

I have the following list:
<id>1</id>
<title>a1</title>
<id>1</id>
<title>a2</title>
<id>2</id>
<title>b1</title>
<id>2</id>
<title>b2</title>

I would like to display the result as:
id:1
title: a1
title: a2
id:2
title: b1
title: b2

I was trying to use xsl:value to keep track of the current id and doing a test to see if its the same id. But, it seems like xslt does not allow me to reassign values to existing variable. How can I accomplish this?

This is what I have so far:

<xsl:param name="oldId" select="//id"/>
<xsl:for-each select="ROWSET/ROW">
<xsl:variable name="currId" select="id"/>
<xsl:choose>
<xsl:when test="$currId &gt; $oldId">
<xsl:param name="oldId" select="id"/>
Jun 12 '07 #1
1 1593
Dököll
2,364 Expert 2GB
I have the following list:
<id>1</id>
<title>a1</title>
<id>1</id>
<title>a2</title>
<id>2</id>
<title>b1</title>
<id>2</id>
<title>b2</title>

I would like to display the result as:
id:1
title: a1
title: a2
id:2
title: b1
title: b2

I was trying to use xsl:value to keep track of the current id and doing a test to see if its the same id. But, it seems like xslt does not allow me to reassign values to existing variable. How can I accomplish this?

This is what I have so far:
Expand|Select|Wrap|Line Numbers
  1.   <xsl:param name="oldId" select="//id"/>
  2.   <xsl:for-each select="ROWSET/ROW">
  3.    <xsl:variable name="currId" select="id"/>
  4.    <xsl:choose>
  5.     <xsl:when test="$currId &gt; $oldId">
  6.         <xsl:param name="oldId" select="id"/>
Expand|Select|Wrap|Line Numbers
  1.  
Have a look here:

http://www.w3schools.com/xsl/default.asp

Continue to stay tuned if you need more help cfli1688!
Jul 4 '07 #2

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

Similar topics

9
by: Daan | last post by:
Hello everyone, The following website looks fine on the latest IE5, IE6 and Firefox. However, in older versions of Internet Explorer, the menu overlaps the text. Does anyone know why this is, or...
3
by: TEK | last post by:
There seems to be a bug when deserialization some classes in the .NET framework. If you try to deserialize a class that has a base class that holds a struct with a member that is implementing...
7
by: Shailesh Humbad | last post by:
I have a class and map like this: class MyObject { ... }; map<int, MyObject> Box; Now, I want to reassign the keys of one or more of the pairs in Box based on another map<int, int> that...
1
by: Vektor | last post by:
I have continuous form with some data that have one field with 6 different values (for example: A, B, C, D, E, F). I want to set BackColor of one text box to 6 different colors based on previous...
0
by: gahagan | last post by:
If you encounter this error, most likely one of the controls you're trying to cut/paste is a combo box with a longer-than-average 'Row Source' value. That, apparently, is the problem. Shorter Row...
3
by: biswaranjan.rath | last post by:
Can i do something like this: <xsl:variable name="varMaxDiffId"> <xsl:choose> <xsl:when test="$varMaxDiffId == 'NULL'"> <xsl:value-of select="-1"/> </xsl:when> <xsl:when test="$varMaxDiffId <...
3
by: Schwammkopf | last post by:
Hi ! What i want to do in C++ is : int a = new a; a = 0, a = 0; int* p = &a; while (1) // any condition instead of 1
8
by: Bernhard Merkle | last post by:
Hi there, I am reading Learning Python 3e from Mark Lutz and just found out that reassigning to builtins is possible. What is the reason, why Python allows this ? IMO this is very risky and can...
6
by: ahilar12 | last post by:
hi all can anybody tell me the logic or the code how to reassign some records from one user to another user
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shćllîpôpď 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.