[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Library functions
>Is the following piece >of psedo code has the correct idea: > > <fo:block > border-before-width = "floor(4.2 div 2.0)*1.0in" > </fo:block> To tell an XSLT processor to evaluate an expression, you put curly braces around it to make it an attribute value template. The string showing the units ("in") will just confuse it when it's trying to do the math, so append that to the result of the calculation by putting it after the right brace. (After all, you're telling the FO processor about the units, not the XSLT processor, which won't know what to do with them.) This gives you the following: <fo:block border-before-width = "{floor(4.2 div 2.0)}in"/> I wrote something for XML.com demonstrating the use of various math functions in XSLT; see http://www.xml.com/pub/a/2001/05/07/xsltmath.html. (It's an excerpt from my book.) Note that the examples in the column don't use attribute value templates because the XSLT processor assumes that the value of an xsl:value-of element's select attribute is an expression to be evaluated. For this reason, you would have to add the "in" units string as a text node outside of the xsl:value-of element. Bob DuCharme www.snee.com/bob <bob@ snee.com> see http://www.snee.com/bob/xsltquickly for info on new book "XSLT Quickly" from Manning Publications. 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
|