[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: whats the best way to create and use values for lo
At 2003-09-12 18:36 -0500, SANWAL, ABHISHEK (HP-Houston) wrote:
How to pickup and insert values for individual column widths from variables/params/(any other value holder with local scope) already present in the XSL by limiting the number of values picked up to a variable that defines the number of columns or a separate count ? Sounds like you want a side effect, which isn't available in XSLT. You will have to repeat in your match of table the same calculation that you did in your match for section so that the variable of local scope in the table template rule has what you need. This is not an uncommon need, but many people with a programming background still think in side-effects, especially changing global variables (the only variables that are in scope for more than one template rule). If you can put your column calculations in a callable template, then you can call that callable template once in your match for section, and then again in your match for table. Each time you are going to your source node tree and recalculating something that you need in two places. Remember: no changing variables in global scope, so if you need a calculated value in more than one template rule, you'll have to repeatedly calculate it in every template rule. When your calculations are based on the source node tree (and note the current node list), then you are guaranteed to get the same result at all times that you do the calculation. If, however, your calculation is based on the current node list, then you'll have to be careful to ensure you are dealing with the same current node list each time you do the calculation. Keys are based on the source node tree and not on a real-time calculation, so you've been mislead about keys. I hope this helps. ............................. Ken -- Next public European delivery: 3-day XSLT/2-day XSL-FO 2003-09-22 Next public US delivery: 3-day XSLT/2-day XSL-FO 2003-10-13 Instructor-led on-site corporate, government & user group training for XSLT and XSL-FO world-wide: please contact us for the details G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) ISBN 0-13-065196-6 Definitive XSLT and XPath ISBN 0-13-140374-5 Definitive XSL-FO ISBN 1-894049-08-X Practical Transformation Using XSLT and XPath ISBN 1-894049-11-X Practical Formatting Using XSL-FO Member of the XML Guild of Practitioners: http://XMLGuild.info Male Breast Cancer Awareness http://www.CraneSoftwrights.com/s/bc XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|