You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Doug Gilbert <do...@nottingham.ac.uk> on 2002/05/08 12:49:17 UTC

numbering newbie

Hi, 
I am trying to number a series of elements gathered from an sql query that gives me a result set like thus:

<somestuff><id = 401></id>..more content here<morestuff>...<subid></subid>the content here I need to number .....</morestuff></somestuff>
<somestuff><id = 401></id>..more content here<morestuff>...<subid></subid>the content here I need to number .....</morestuff></somestuff>
<somestuff><id = 401></id>..more content here<morestuff>...<subid></subid>the content here I need to number .....</morestuff></somestuff>
<somestuff><id = 765></id>..more content here<morestuff>...<subid></subid>the content here I need to number .....</morestuff></somestuff>
<somestuff><id = 765></id>..more content here<morestuff>...<subid></subid>the content here I need to number .....</morestuff></somestuff>
<somestuff><id = 952></id>..more content here<morestuff>...<subid></subid>the content here I need to number .....</morestuff></somestuff>

I need to number the nodes relative to their position within id thus
id = 401-subid = 1
            -subid = 2
            -subid = 3

etc
I have tried  number and position, but what I really need is to increment a counter, I know this appears to be out of the question, so....any help would be fantastic

Thanks
                





Re: numbering newbie

Posted by Bert Van Kets <be...@vankets.com>.
I'd quickly get it over with and set up an XSP with a counter.  It's very 
easy to mix esql with Java code in an XSP.
Check out the docs and the samples and you'll see what I mean.
Bert

At 14:45 8/05/2002 +0200, you wrote:
>When You use of esql logicsheet try:
><subid><xsp:expr><esql:get-row-position/>+1</xsp:expr></subid>
>Of course You need to insert it in Your generator and generator need to be 
>serverpages type.
>Regards
>Jerzy
>>----- Original Message -----
>>From: <ma...@nottingham.ac.uk>Doug Gilbert
>>To: <ma...@xml.apache.org>cocoon-users@xml.apache.org
>>Sent: Wednesday, May 08, 2002 12:49 PM
>>Subject: numbering newbie
>>
>>Hi,
>>I am trying to number a series of elements gathered from an sql query 
>>that gives me a result set like thus:
>>
>><somestuff><id = 401></id>..more content 
>>here<morestuff>...<subid></subid>the content here I need to number 
>>.....</morestuff></somestuff>
>><somestuff><id = 401></id>..more content 
>>here<morestuff>...<subid></subid>the content here I need to number 
>>.....</morestuff></somestuff>
>><somestuff><id = 401></id>..more content 
>>here<morestuff>...<subid></subid>the content here I need to number 
>>.....</morestuff></somestuff>
>><somestuff><id = 765></id>..more content 
>>here<morestuff>...<subid></subid>the content here I need to number 
>>.....</morestuff></somestuff>
>><somestuff><id = 765></id>..more content 
>>here<morestuff>...<subid></subid>the content here I need to number 
>>.....</morestuff></somestuff>
>><somestuff><id = 952></id>..more content 
>>here<morestuff>...<subid></subid>the content here I need to number 
>>.....</morestuff></somestuff>
>>
>>I need to number the nodes relative to their position within id thus
>>id = 401-subid = 1
>>             -subid = 2
>>             -subid = 3
>>
>>etc
>>I have tried  number and position, but what I really need is to increment 
>>a counter, I know this appears to be out of the question, so....any help 
>>would be fantastic
>>
>>Thanks
>>
>>
>>
>>
>>


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: numbering newbie

Posted by Jerzy Kut <je...@rzeszow.tiger.com.pl>.
When You use of esql logicsheet try:
<subid><xsp:expr><esql:get-row-position/>+1</xsp:expr></subid>
Of course You need to insert it in Your generator and generator need to be serverpages type.
Regards
Jerzy
  ----- Original Message ----- 
  From: Doug Gilbert 
  To: cocoon-users@xml.apache.org 
  Sent: Wednesday, May 08, 2002 12:49 PM
  Subject: numbering newbie


  Hi, 
  I am trying to number a series of elements gathered from an sql query that gives me a result set like thus:
   
  <somestuff><id = 401></id>..more content here<morestuff>...<subid></subid>the content here I need to number .....</morestuff></somestuff>
  <somestuff><id = 401></id>..more content here<morestuff>...<subid></subid>the content here I need to number .....</morestuff></somestuff>
  <somestuff><id = 401></id>..more content here<morestuff>...<subid></subid>the content here I need to number .....</morestuff></somestuff>
  <somestuff><id = 765></id>..more content here<morestuff>...<subid></subid>the content here I need to number .....</morestuff></somestuff>
  <somestuff><id = 765></id>..more content here<morestuff>...<subid></subid>the content here I need to number .....</morestuff></somestuff>
  <somestuff><id = 952></id>..more content here<morestuff>...<subid></subid>the content here I need to number .....</morestuff></somestuff>

  I need to number the nodes relative to their position within id thus
  id = 401-subid = 1
              -subid = 2
              -subid = 3

  etc
  I have tried  number and position, but what I really need is to increment a counter, I know this appears to be out of the question, so....any help would be fantastic

  Thanks