[Home] [By Thread] [By Date] [Recent Entries]
At 2014-11-03 19:48 +0000, Catherine Wilbur cwilbur@xxxxxxxxxxx wrote:
Looked on the archive and did not see anything similar to what I am doing. Because what you are doing is not allowed, as you are thinking of XSLT in terms of other programming languages that do not work the same way. I am trying to put a sequence number for each output line. Each time I output a line I want to increment the counter by one. That's the problem. Rather than wanting that, I think what you want to do is reflect the invoice line number since it looks like you are creating an output for each invoice line. There are a couple ways of doing this: if you are processing invoice lines as a group you can use position(), if you are processing items inside of invoice lines you can count which invoice line you are at by using <xsl:number/>: <xsl:number count="invoice_line"/> Putting out your entire stylesheet into a help request inhibits getting help because people like me can't take the time to figure out what you are doing. You haven't narrowed down your issue to an XSLT example of a few lines that illustrates the problem you are having. So if I've guessed incorrectly at what you are trying to do, then my example above is likely wrong, but the principle is correct: XSLT will count the input tree for you, so if you want the output to reflect the ordinal position of information in your input, you don't have to create and maintain a counter, you just have to report that aspect of your input in your output. I hope this helps. If you would like to listen to a lecture on <xsl:number/> it happens to be available as a free preview in streaming video at: http://www.CraneSoftwrights.com/links/ptux-coupon.htm (note that I've used a link offering a 60% discount off of the list price) The free lecture is Module 7 Lesson 2 ... just scroll down the page to find it. I hope this helps. . . . . . . Ken
|

Cart



