1<?xml version="1.0"?> 2<xsl:stylesheet version="1.0" 3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 4 xmlns:math="http://exslt.org/math" 5 extension-element-prefixes="math"> 6 7<!-- Test math:sin() --> 8 9<xsl:variable name="zero" select="0"/> 10<xsl:variable name="nzero" select="-0"/> 11<xsl:variable name="num1" select="1.99"/> 12<xsl:variable name="num2" select="3.1428475"/> 13<xsl:variable name="temp1" select="-7"/> 14<xsl:variable name="temp2" select="-9.99999"/> 15<xsl:variable name="rad1" select="1.0"/> 16<xsl:variable name="rad2" select="25"/> 17<xsl:variable name="rad3" select="0.253"/> 18<xsl:variable name="rad4" select="-0.888"/> 19<xsl:variable name="input1" select="number(//number[1])"/> 20<xsl:variable name="input2" select="number(//number[2])"/> 21<xsl:variable name="input3" select="$input1 div $zero"/> 22 23<xsl:template match="/"> 24 <out> 25 Sin value of zero is: 26 <xsl:value-of select="math:sin($zero)"/><br/> 27 Sin value of nzero is: 28 <xsl:value-of select="math:sin($nzero)"/><br/> 29 Sin value of num1 is: 30 <xsl:value-of select="math:sin($num1)"/><br/> 31 Sin value of num2 is: 32 <xsl:value-of select="math:sin($num2)"/><br/> 33 Sin value of temp1 is: 34 <xsl:value-of select="math:sin($temp1)"/><br/> 35 Sin value of temp2 is: 36 <xsl:value-of select="math:sin($temp2)"/><br/> 37 Sin value of rad1 is: 38 <xsl:value-of select="math:sin($rad1)"/><br/> 39 Sin value of rad2 is: 40 <xsl:value-of select="math:sin($rad2)"/><br/> 41 Sin value of rad3 is: 42 <xsl:value-of select="math:sin($rad3)"/><br/> 43 Sin value of rad4 is: 44 <xsl:value-of select="math:sin($rad4)"/><br/> 45 Sin value of input1 is: 46 <xsl:value-of select="math:sin($input1)"/><br/> 47 Sin value of input2 is: 48 <xsl:value-of select="math:sin($input2)"/><br/> 49 Sin value of input3 is: 50 <xsl:value-of select="math:sin($input3)"/> 51 </out> 52</xsl:template> 53 54 55 <!-- 56 * Licensed to the Apache Software Foundation (ASF) under one 57 * or more contributor license agreements. See the NOTICE file 58 * distributed with this work for additional information 59 * regarding copyright ownership. The ASF licenses this file 60 * to you under the Apache License, Version 2.0 (the "License"); 61 * you may not use this file except in compliance with the License. 62 * You may obtain a copy of the License at 63 * 64 * http://www.apache.org/licenses/LICENSE-2.0 65 * 66 * Unless required by applicable law or agreed to in writing, software 67 * distributed under the License is distributed on an "AS IS" BASIS, 68 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 69 * See the License for the specific language governing permissions and 70 * limitations under the License. 71 --> 72 73</xsl:stylesheet> 74