469,307 Members | 1,836 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,307 developers. It's quick & easy.

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 1531
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

Post your reply

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

Similar topics

9 posts views Thread by Daan | last post: by
7 posts views Thread by Shailesh Humbad | last post: by
3 posts views Thread by biswaranjan.rath | last post: by
3 posts views Thread by Schwammkopf | last post: by
8 posts views Thread by Bernhard Merkle | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.