|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Calculating column widths
> My question: > how can I do this calculation in one parse? > The sum() function requires a node-set > and numeric values to function properly, > and I have been unable to do the stripping > and the calculation in one template. You could do the summation "by hand" in a recursive template, rather than using the sum() function, but I'm not sure I'd recommend this. It rather depends what you're trying to achieve. You can of course do a two-pass transformation using a result-tree-fragment for the intermediate results and using RTF-to-nodeset conversion for the second pass. Alternatively, Saxon has the extension function saxon:sum(node-set, expression) which allows you to sum over the result of an XPath expression applied to the context node. This expression can also contain a call on a saxon:function() defined in the stylesheet. (But you could strip off the units part of your numbers using a standard expression based on translate(), converting all alpha characters to spaces). I'm not sure any of these is a real improvement on what you're currently doing. Mike Kay 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
|

Cart








