[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Calculating
Probably this doesn't work for Gunter because he is not using the namespace http://www.w3.org/1999/XSL/Transform. PC2 -----Original Message----- From: Lawrence Mielniczuk [mailto:lwm@xxxxxxxxxxxxxxx] Sent: May 28, 2001 06:04 To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: Calculating I'm sure there are more elegant solutions but try this: Given XML --------------- <?xml version="1.0"?> <thing> <amount>7</amount> <price>2.50</price> </thing> stylesheet --------------- <?xml version="1.0"?> <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="text"/> <xsl:template match="thing"> <xsl:value-of select="./amount * ./price"/> </xsl:template> </xsl:transform> bash$ saxon thing.xml thing.xsl 17.5 $bash > Hello, > > in my XML file I got two elements named price and amount. Is it > possible to multiplicate the value of these elements in a xsl > stylesheet and display it as total amount. > In a book I found an example, that in XSL files you can work with > arithmetical terms, but every syntax I tried, did not work. I always > got the error "Expected token 'eof' found '*'". > > Thanks in advance > > Günter Hofmann 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
|