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:cos() --> 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 Cos value of zero is: 26 <xsl:value-of select="math:cos($zero)"/><br/> 27 Cos value of nzero is: 28 <xsl:value-of select="math:cos($nzero)"/><br/> 29 Cos value of num1 is: 30 <xsl:value-of select="math:cos($num1)"/><br/> 31 Cos value of num2 is: 32 <xsl:value-of select="math:cos($num2)"/><br/> 33 Cos value of temp1 is: 34 <xsl:value-of select="math:cos($temp1)"/><br/> 35 Cos value of temp2 is: 36 <xsl:value-of select="math:cos($temp2)"/><br/> 37 Cos value of rad1 is: 38 <xsl:value-of select="math:cos($rad1)"/><br/> 39 Cos value of rad2 is: 40 <xsl:value-of select="math:cos($rad2)"/><br/> 41 Cos value of rad3 is: 42 <xsl:value-of select="math:cos($rad3)"/><br/> 43 Cos value of rad4 is: 44 <xsl:value-of select="math:cos($rad4)"/><br/> 45 Cos value of input1 number is: 46 <xsl:value-of select="math:cos($input1)"/><br/> 47 Cos value of input2 number is: 48 <xsl:value-of select="math:cos($input2)"/><br/> 49 Cos value of input3 number is: 50 <xsl:value-of select="math:cos($input3)"/> 51 52 </out> 53</xsl:template> 54 55 56 <!-- 57 * Licensed to the Apache Software Foundation (ASF) under one 58 * or more contributor license agreements. See the NOTICE file 59 * distributed with this work for additional information 60 * regarding copyright ownership. The ASF licenses this file 61 * to you under the Apache License, Version 2.0 (the "License"); 62 * you may not use this file except in compliance with the License. 63 * You may obtain a copy of the License at 64 * 65 * http://www.apache.org/licenses/LICENSE-2.0 66 * 67 * Unless required by applicable law or agreed to in writing, software 68 * distributed under the License is distributed on an "AS IS" BASIS, 69 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 70 * See the License for the specific language governing permissions and 71 * limitations under the License. 72 --> 73 74</xsl:stylesheet> 75