Altova Mailing List Archives


RE: [xsl] Incrementing a Global variable

From: "Michael Kay" <mhk@--------->
To:
Date: 8/25/2003 6:55:00 AM
Your problem description isn't very clear, but at first sight it looks
as if the problem could easily be solved by doing the numbering in a
second pass, i.e. by creating a result tree and then using it as input
to a second transformation by using xx:node-set().

Michael Kay

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Rajendra S Rawat
> Sent: 25 August 2003 11:37
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] Incrementing a Global variable
> 
> 
> This drawback of XSL/XSL:FO is quite frustating
> 
> 
> 
> I want something like this 
> --------------------------------------
> |Sl No | STUDENT NAME     | TOption   |
> --------------------------------------
> | 1    |  SAM             |  English  | <-
> position()=1
> --------------------------------------
> | 2    |  RAJ             |  English  | <-
> position()=2
> --------------------------------------
> | 3    |  RON             |  English  | <-
> position()=3
> --------------------------------------
> | 4    |                  |           |
> --------------------------------------
> | 5    |  JON             |  German   | <-
> position()=4
> --------------------------------------
> | 6    |  DON             |  German   | <-
> position()=5
> --------------------------------------
> | 7    |                  |           |
> -------------------------------------- 
> | 8    |  MON             |  Hebrew   | <-
> position()=6
> --------------------------------------
> | 9    |  GON             |  Hebrew   | <-
> position()=7
> --------------------------------------
> | 10   | TOTAL= 7         |           |
> --------------------------------------
> | 11   |                  |           |
> --------------------------------------
> | 12   |                  |           |
> --------------------------------------
> | 13   |                  |           |
> -------------------------------------- 
> | 14   |                  |           |
> --------------------------------------
> | 15   |                  |           |
> --------------------------------------
> 
> Pl. Note 
> 1. the rows with out values
> 2. position() is not same as Sl No.
> 3. blank rows continues till end of page
> 4. after first break diff between position() and Sl
> No. is 1 (then after second break 2 ....)
> 5. this is only a very tiny part of xml/output used to
> just illustrate the problem, So I cannot use static
> sl. no. (it is in a <xsl:for-each select="Student"
> ..loop)
> 
> 
> I have however created above table (breaks by grouping
> and extra blank-rows by recursion)
> 
> but could not get Sl. No. ordered
> I can get something like
> --------------------------------------
> |Sl No | STUDENT NAME     | TOption   |
> --------------------------------------
> | 1    |  SAM             |  English  | <-
> position()=1
> --------------------------------------
> | 2    |  RAJ             |  English  | <-
> position()=2
> --------------------------------------
> | 3    |  RON             |  English  | <-
> position()=3
> --------------------------------------
> |      |                  |           |
> --------------------------------------
> | 4    |  JON             |  German   | <-
> position()=4
> --------------------------------------
> | 5    |  DON             |  German   | <-
> position()=5
> --------------------------------------
> |      |                  |           |
> --------------------------------------
> | 6    |  MON             |  Hebrew   |<- position()=6
> --------------------------------------
> | 7    |  GON             |  Hebrew   |<- position()=7
> --------------------------------------
> | 10   | TOTAL= 7         |           |
> --------------------------------------
> | 11   |                  |           |
> --------------------------------------
> | 12   |                  |           |
> --------------------------------------
> | 13   |                  |           |
> -------------------------------------- 
> | 14   |                  |           |
> --------------------------------------
> | 15   |                  |           |
> --------------------------------------
> 
> 
> I got last sl no.(10-15) ordered by using 
> 1. break-count(here 2) 
> 2. Student nodes count(here 7) 
> 3. total no. of rows (here 15)(fixed)
> 
> Actual Problem is to print Sl No.(Here 1 to 9)
> 
> Only solution I suppose, is adding 1,2... after
> 1st,2nd... breaks but for that I require a global
> variable which I can increment and add after every 
> break.........BUT....in XSL  variables are read only!!!!!!!
> 
> 
> can anybody show me a way? 
> 
> (Pl. Also Note Final out put is in PDF.Can it be
> achieved with FO .....with backgroud image or Absolute Positioning...
> 
> for this problem I also tried ft:assign but failed to
> use it
> 
> Has any body used ft:assign? )
> 
> 
> 
> 
> tia
> 
> Regards,
> Raj
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design 
> software http://sitebuilder.yahoo.com
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Disclaimer

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.