From: Oleg T. <he...@us...> - 2005-10-16 20:13:21
|
Update of /cvsroot/mvp-xml/EXSLT/v2/test/ExsltTest/tests/EXSLT/Math In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14178/v2/test/ExsltTest/tests/EXSLT/Math Added Files: abs.xslt acos.xslt asin.xslt atan.xslt atan2.xslt constant.xslt cos.xslt exp.xslt highest.xslt log.xslt lowest.xslt max.xslt min.xslt power.xslt random.xslt sin.xslt source.xml sqrt.xslt tan.xslt Log Message: --- NEW FILE: atan.xslt --- <?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:math="http://exslt.org/math" exclude-result-prefixes="math"> <xsl:output indent="yes" omit-xml-declaration="yes"/> <xsl:template match="/"> <out> <test1> <xsl:value-of select="math:atan(0.5)"/> </test1> <test2> <xsl:value-of select="math:atan(-0.9)"/> </test2> <test3> <xsl:value-of select="math:atan(/data/bad-data)"/> </test3> <test4> <xsl:value-of select="math:atan(22 div 0)"/> </test4> <test5> <xsl:value-of select="math:atan(-22 div 0)"/> </test5> <test6> <xsl:value-of select="math:atan(0)"/> </test6> </out> </xsl:template> </xsl:stylesheet> --- NEW FILE: asin.xslt --- <?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:math="http://exslt.org/math" exclude-result-prefixes="math"> <xsl:output indent="yes" omit-xml-declaration="yes"/> <xsl:template match="/"> <out> <test1> <xsl:value-of select="math:asin(0.5)"/> </test1> <test2> <xsl:value-of select="math:asin(-0.9)"/> </test2> <test3> <xsl:value-of select="math:asin(/data/bad-data)"/> </test3> <test4> <xsl:value-of select="math:asin(22 div 0)"/> </test4> <test5> <xsl:value-of select="math:asin(-22 div 0)"/> </test5> <test6> <xsl:value-of select="math:asin(0)"/> </test6> </out> </xsl:template> </xsl:stylesheet> --- NEW FILE: lowest.xslt --- <?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:math="http://exslt.org/math" exclude-result-prefixes="math"> <xsl:output indent="yes" omit-xml-declaration="yes"/> <xsl:template match="/"> <out> <test1> lowest orders: <xsl:copy-of select="math:lowest(/data/orders/order)"/> </test1> <test2> lowest orders: <xsl:copy-of select="math:lowest(/no/such/nodes)"/> </test2> <test3> lowest orders: <xsl:copy-of select="math:lowest(/data/bad-data)"/> </test3> </out> </xsl:template> </xsl:stylesheet> --- NEW FILE: highest.xslt --- <?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:math="http://exslt.org/math" exclude-result-prefixes="math"> <xsl:output indent="yes" omit-xml-declaration="yes"/> <xsl:template match="/"> <out> <test1> Max orders: <xsl:copy-of select="math:highest(/data/orders/order)"/> </test1> <test2> Max orders: <xsl:copy-of select="math:highest(/no/such/nodes)"/> </test2> <test3> Max orders: <xsl:copy-of select="math:highest(/data/bad-data)"/> </test3> </out> </xsl:template> </xsl:stylesheet> --- NEW FILE: log.xslt --- <?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:math="http://exslt.org/math" exclude-result-prefixes="math"> <xsl:output indent="yes" omit-xml-declaration="yes"/> <xsl:template match="/"> <out> <test1> <xsl:value-of select="math:log(-22.9)"/> </test1> <test2> <xsl:value-of select="math:log(22.9)"/> </test2> <test3> <xsl:value-of select="math:log(/data/bad-data)"/> </test3> <test4> <xsl:value-of select="math:log(22 div 0)"/> </test4> <test5> <xsl:value-of select="math:log(-22 div 0)"/> </test5> </out> </xsl:template> </xsl:stylesheet> --- NEW FILE: atan2.xslt --- <?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:math="http://exslt.org/math" exclude-result-prefixes="math"> <xsl:output indent="yes" omit-xml-declaration="yes"/> <xsl:template match="/"> <out> <test1> <xsl:value-of select="math:atan2(0.5, 0.7)"/> </test1> <test2> <xsl:value-of select="math:atan2(-0.9, -0.4)"/> </test2> <test3> <xsl:value-of select="math:atan2(/data/bad-data, 4)"/> </test3> <test4> <xsl:value-of select="math:atan2(22 div 0, 3)"/> </test4> <test5> <xsl:value-of select="math:atan2(-22 div 0, 2)"/> </test5> <test6> <xsl:value-of select="math:atan2(0, 0)"/> </test6> </out> </xsl:template> </xsl:stylesheet> --- NEW FILE: power.xslt --- <?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:math="http://exslt.org/math" exclude-result-prefixes="math"> <xsl:output indent="yes" omit-xml-declaration="yes"/> <xsl:template match="/"> <out> <test1> <xsl:value-of select="math:power(3, 2)"/> </test1> <test2> <xsl:value-of select="math:power(-22.9, 3.5)"/> </test2> <test3> <xsl:value-of select="math:power(/data/bad-data, /data/bad-data)"/> </test3> <test4> <xsl:value-of select="math:power(22 div 0, 3)"/> </test4> <test5> <xsl:value-of select="math:power(334, -22 div 0)"/> </test5> <test6> <xsl:value-of select="math:power(2, -2)"/> </test6> </out> </xsl:template> </xsl:stylesheet> --- NEW FILE: sin.xslt --- <?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:math="http://exslt.org/math" exclude-result-prefixes="math"> <xsl:output indent="yes" omit-xml-declaration="yes"/> <xsl:template match="/"> <out> <test1> <xsl:value-of select="math:sin(360)"/> </test1> <test2> <xsl:value-of select="math:sin(-22.9)"/> </test2> <test3> <xsl:value-of select="math:sin(/data/bad-data)"/> </test3> <test4> <xsl:value-of select="math:sin(22 div 0)"/> </test4> <test5> <xsl:value-of select="math:sin(-22 div 0)"/> </test5> </out> </xsl:template> </xsl:stylesheet> --- NEW FILE: exp.xslt --- <?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:math="http://exslt.org/math" exclude-result-prefixes="math"> <xsl:output indent="yes" omit-xml-declaration="yes"/> <xsl:template match="/"> <out> <test1> <xsl:value-of select="math:exp(30)"/> </test1> <test2> <xsl:value-of select="math:exp(-22)"/> </test2> <test3> <xsl:value-of select="math:exp(/data/bad-data)"/> </test3> <test4> <xsl:value-of select="math:exp(22 div 0)"/> </test4> <test5> <xsl:value-of select="math:exp(-22 div 0)"/> </test5> <test6> <xsl:value-of select="math:exp(2.5)"/> </test6> </out> </xsl:template> </xsl:stylesheet> --- NEW FILE: source.xml --- <?xml version="1.0" encoding="utf-8" ?> <?xml-stylesheet type="text/xsl" href="acos.xslt"?> <data> <orders> <order>100</order> <order>1.99</order> <order>12.99</order> <order>59.99</order> <order>2.99</order> <order>1.99</order> <order>999.99</order> <order>123.45</order> <order>999.99</order> </orders> <bad-data>23.99]</bad-data> <bad-data>22.99</bad-data> </data> --- NEW FILE: cos.xslt --- <?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:math="http://exslt.org/math" exclude-result-prefixes="math"> <xsl:output indent="yes" omit-xml-declaration="yes"/> <xsl:template match="/"> <out> <test1> <xsl:value-of select="math:cos(360)"/> </test1> <test2> <xsl:value-of select="math:cos(-22.9)"/> </test2> <test3> <xsl:value-of select="math:cos(/data/bad-data)"/> </test3> <test4> <xsl:value-of select="math:cos(22 div 0)"/> </test4> <test5> <xsl:value-of select="math:cos(-22 div 0)"/> </test5> </out> </xsl:template> </xsl:stylesheet> --- NEW FILE: tan.xslt --- <?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:math="http://exslt.org/math" exclude-result-prefixes="math"> <xsl:output indent="yes" omit-xml-declaration="yes"/> <xsl:template match="/"> <out> <test1> <xsl:value-of select="math:tan(360)"/> </test1> <test2> <xsl:value-of select="math:tan(-22.9)"/> </test2> <test3> <xsl:value-of select="math:tan(/data/bad-data)"/> </test3> <test4> <xsl:value-of select="math:tan(22 div 0)"/> </test4> <test5> <xsl:value-of select="math:tan(-22 div 0)"/> </test5> </out> </xsl:template> </xsl:stylesheet> --- NEW FILE: min.xslt --- <?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:math="http://exslt.org/math" exclude-result-prefixes="math"> <xsl:output indent="yes" omit-xml-declaration="yes"/> <xsl:template match="/"> <out> <test1> Minimal order: <xsl:value-of select="math:min(/data/orders/order)"/> </test1> <test2> Minimal order: <xsl:value-of select="math:min(/no/such/nodes)"/> </test2> <test3> Minimal order: <xsl:value-of select="math:min(/data/bad-data)"/> </test3> </out> </xsl:template> </xsl:stylesheet> --- NEW FILE: acos.xslt --- <?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:math="http://exslt.org/math" exclude-result-prefixes="math"> <xsl:output indent="yes" omit-xml-declaration="yes"/> <xsl:template match="/"> <out> <test1> <xsl:value-of select="math:acos(0.5)"/> </test1> <test2> <xsl:value-of select="math:acos(-0.9)"/> </test2> <test3> <xsl:value-of select="math:acos(/data/bad-data)"/> </test3> <test4> <xsl:value-of select="math:acos(22 div 0)"/> </test4> <test5> <xsl:value-of select="math:acos(-22 div 0)"/> </test5> <test6> <xsl:value-of select="math:acos(0)"/> </test6> </out> </xsl:template> </xsl:stylesheet> --- NEW FILE: random.xslt --- <?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:math="http://exslt.org/math" exclude-result-prefixes="math"> <xsl:output indent="yes" omit-xml-declaration="yes"/> <xsl:template match="/"> <out> <test1> <xsl:variable name="rnd" select="math:random()"/> <xsl:value-of select="$rnd >= 0 and $rnd <= 1"/> </test1> </out> </xsl:template> </xsl:stylesheet> --- NEW FILE: sqrt.xslt --- <?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:math="http://exslt.org/math" exclude-result-prefixes="math"> <xsl:output indent="yes" omit-xml-declaration="yes"/> <xsl:template match="/"> <out> <test1> <xsl:value-of select="math:sqrt(9)"/> </test1> <test2> <xsl:value-of select="math:sqrt(-22.9)"/> </test2> <test3> <xsl:value-of select="math:sqrt(/data/bad-data)"/> </test3> <test4> <xsl:value-of select="math:sqrt(22 div 0)"/> </test4> <test5> <xsl:value-of select="math:sqrt(-22 div 0)"/> </test5> </out> </xsl:template> </xsl:stylesheet> --- NEW FILE: max.xslt --- <?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:math="http://exslt.org/math" exclude-result-prefixes="math"> <xsl:output indent="yes" omit-xml-declaration="yes"/> <xsl:template match="/"> <out> <test1> Max order: <xsl:value-of select="math:max(/data/orders/order)"/> </test1> <test2> Max order: <xsl:value-of select="math:max(/no/such/nodes)"/> </test2> <test3> Max order: <xsl:value-of select="math:max(/data/bad-data)"/> </test3> </out> </xsl:template> </xsl:stylesheet> --- NEW FILE: constant.xslt --- <?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:math="http://exslt.org/math" exclude-result-prefixes="math"> <xsl:output indent="yes" omit-xml-declaration="yes"/> <xsl:template match="/"> <out> <test1> <xsl:value-of select="math:constant('PI', 10)"/> </test1> <test2> <xsl:value-of select="math:constant('E', 100)"/> </test2> <test3> <xsl:value-of select="math:constant('SQRRT2', 10)"/> </test3> <test4> <xsl:value-of select="math:constant('LN2', 3)"/> </test4> <test5> <xsl:value-of select="math:constant('LN10', 3)"/> </test5> <test6> <xsl:value-of select="math:constant('LOG2E', 4)"/> </test6> <test7> <xsl:value-of select="math:constant('SQRT1_2', 5)"/> </test7> <test8> <xsl:value-of select="math:constant('PI', -1)"/> </test8> <test9> <xsl:value-of select="math:constant('PI', 22 div 0)"/> </test9> <test10> <xsl:value-of select="math:constant('PI', -22 div 0)"/> </test10> </out> </xsl:template> </xsl:stylesheet> --- NEW FILE: abs.xslt --- <?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:math="http://exslt.org/math" exclude-result-prefixes="math"> <xsl:output indent="yes" omit-xml-declaration="yes"/> <xsl:template match="/"> <out> <test1> <xsl:value-of select="math:abs(-22.9)"/> </test1> <test2> <xsl:value-of select="math:abs(22.9)"/> </test2> <test3> <xsl:value-of select="math:abs(/data/bad-data)"/> </test3> <test4> <xsl:value-of select="math:abs(22 div 0)"/> </test4> <test5> <xsl:value-of select="math:abs(-22 div 0)"/> </test5> </out> </xsl:template> </xsl:stylesheet> |