summaryrefslogtreecommitdiffstats
path: root/libxslt/tests/exslt/math
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2017-05-03 15:29:42 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2017-05-03 15:29:42 (GMT)
commit937cfaf1a06a4a9d0c8ba119d7ce820878ff9058 (patch)
treef7b0b1bcce9ae963a0a069eafa552350eb4ee391 /libxslt/tests/exslt/math
parent4b8453f0303492a1de2dcf854555f6429fac550e (diff)
downloadblt-937cfaf1a06a4a9d0c8ba119d7ce820878ff9058.zip
blt-937cfaf1a06a4a9d0c8ba119d7ce820878ff9058.tar.gz
blt-937cfaf1a06a4a9d0c8ba119d7ce820878ff9058.tar.bz2
inital commit
Diffstat (limited to 'libxslt/tests/exslt/math')
-rw-r--r--libxslt/tests/exslt/math/Makefile.am57
-rw-r--r--libxslt/tests/exslt/math/highest.1.out2
-rw-r--r--libxslt/tests/exslt/math/highest.1.xml7
-rw-r--r--libxslt/tests/exslt/math/highest.1.xsl14
-rw-r--r--libxslt/tests/exslt/math/highest.2.out2
-rw-r--r--libxslt/tests/exslt/math/highest.2.xml2
-rw-r--r--libxslt/tests/exslt/math/highest.2.xsl14
-rw-r--r--libxslt/tests/exslt/math/highest.5.out8
-rw-r--r--libxslt/tests/exslt/math/highest.5.xml10
-rw-r--r--libxslt/tests/exslt/math/highest.5.xsl18
-rw-r--r--libxslt/tests/exslt/math/lowest.1.out2
-rw-r--r--libxslt/tests/exslt/math/lowest.1.xml7
-rw-r--r--libxslt/tests/exslt/math/lowest.1.xsl14
-rw-r--r--libxslt/tests/exslt/math/lowest.2.out2
-rw-r--r--libxslt/tests/exslt/math/lowest.2.xml2
-rw-r--r--libxslt/tests/exslt/math/lowest.2.xsl14
-rw-r--r--libxslt/tests/exslt/math/max.1.out2
-rw-r--r--libxslt/tests/exslt/math/max.1.xml7
-rw-r--r--libxslt/tests/exslt/math/max.1.xsl14
-rw-r--r--libxslt/tests/exslt/math/max.2.out2
-rw-r--r--libxslt/tests/exslt/math/max.2.xml2
-rw-r--r--libxslt/tests/exslt/math/max.2.xsl14
-rw-r--r--libxslt/tests/exslt/math/max.3.out4
-rw-r--r--libxslt/tests/exslt/math/max.3.xml9
-rw-r--r--libxslt/tests/exslt/math/max.3.xsl80
-rw-r--r--libxslt/tests/exslt/math/max.5.out4
-rw-r--r--libxslt/tests/exslt/math/max.5.xml6
-rw-r--r--libxslt/tests/exslt/math/max.5.xsl10
-rw-r--r--libxslt/tests/exslt/math/min.1.out2
-rw-r--r--libxslt/tests/exslt/math/min.1.xml7
-rw-r--r--libxslt/tests/exslt/math/min.1.xsl14
-rw-r--r--libxslt/tests/exslt/math/min.2.out2
-rw-r--r--libxslt/tests/exslt/math/min.2.xml2
-rw-r--r--libxslt/tests/exslt/math/min.2.xsl14
-rw-r--r--libxslt/tests/exslt/math/power.1.out8
-rw-r--r--libxslt/tests/exslt/math/power.1.xml8
-rw-r--r--libxslt/tests/exslt/math/power.1.xsl19
37 files changed, 405 insertions, 0 deletions
diff --git a/libxslt/tests/exslt/math/Makefile.am b/libxslt/tests/exslt/math/Makefile.am
new file mode 100644
index 0000000..68bea6a
--- /dev/null
+++ b/libxslt/tests/exslt/math/Makefile.am
@@ -0,0 +1,57 @@
+## Process this file with automake to produce Makefile.in
+
+$(top_builddir)/xsltproc/xsltproc:
+ @(cd ../../../xsltproc ; $(MAKE) xsltproc)
+
+EXTRA_DIST = \
+ highest.1.out highest.1.xml highest.1.xsl \
+ highest.2.out highest.2.xml highest.2.xsl \
+ highest.5.out highest.5.xml highest.5.xsl \
+ lowest.1.out lowest.1.xml lowest.1.xsl \
+ lowest.2.out lowest.2.xml lowest.2.xsl \
+ max.1.out max.1.xml max.1.xsl \
+ max.2.out max.2.xml max.2.xsl \
+ max.3.out max.3.xml max.3.xsl \
+ max.5.out max.5.xml max.5.xsl \
+ power.1.out power.1.xml power.1.xsl \
+ min.1.out min.1.xml min.1.xsl \
+ min.2.out min.2.xml min.2.xsl
+
+CLEANFILES = .memdump
+
+valgrind:
+ @echo '## Running the regression tests under Valgrind'
+ $(MAKE) CHECKER='libtool --mode=execute valgrind -q --leak-check=full' tests
+
+test tests: $(top_builddir)/xsltproc/xsltproc
+ @echo '## Running exslt math tests'
+ @(echo > .memdump)
+ @(for i in $(srcdir)/*.xsl ; do \
+ name=`basename $$i .xsl` ; \
+ if [ ! -f $(srcdir)/$$name.xml ] ; then continue ; fi ; \
+ log=`$(CHECKER) $(top_builddir)/xsltproc/xsltproc \
+ $(srcdir)/$$name.xsl $(srcdir)/$$name.xml > $$name.res 2>$$name.bad;\
+ if [ ! -f $(srcdir)/$$name.out ] ; then \
+ cp $$name.res $(srcdir)/$$name.out ; \
+ if [ -s $$name.bad ] ; then \
+ mv $$name.bad $(srcdir)/$$name.err ; \
+ fi ; \
+ else \
+ if [ ! -s $$name.res ] ; then \
+ echo "Fatal error, no $$name.res\n" ; \
+ else \
+ diff $(srcdir)/$$name.out $$name.res ; \
+ if [ -s $(srcdir)/$$name.err ] ; then \
+ diff $(srcdir)/$$name.err $$name.bad; \
+ else \
+ diff /dev/null $$name.bad; \
+ fi ; \
+ fi ; \
+ fi; \
+ grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" || true`;\
+ if [ -n "$$log" ] ; then \
+ echo $$name result ; \
+ echo "$$log" ; \
+ fi ; \
+ rm -f $$name.res $$name.bad ; \
+ done)
diff --git a/libxslt/tests/exslt/math/highest.1.out b/libxslt/tests/exslt/math/highest.1.out
new file mode 100644
index 0000000..471e8dc
--- /dev/null
+++ b/libxslt/tests/exslt/math/highest.1.out
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<result>Highest: two</result>
diff --git a/libxslt/tests/exslt/math/highest.1.xml b/libxslt/tests/exslt/math/highest.1.xml
new file mode 100644
index 0000000..bb438f3
--- /dev/null
+++ b/libxslt/tests/exslt/math/highest.1.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<values>
+ <value id="one">7</value>
+ <value id="two">11</value>
+ <value id="three">8</value>
+ <value id="four">4</value>
+</values> \ No newline at end of file
diff --git a/libxslt/tests/exslt/math/highest.1.xsl b/libxslt/tests/exslt/math/highest.1.xsl
new file mode 100644
index 0000000..eccb186
--- /dev/null
+++ b/libxslt/tests/exslt/math/highest.1.xsl
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<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:template match="values">
+ <result>
+ <xsl:text>Highest: </xsl:text>
+ <xsl:value-of select="math:highest(value)/@id" />
+ </result>
+</xsl:template>
+
+</xsl:stylesheet> \ No newline at end of file
diff --git a/libxslt/tests/exslt/math/highest.2.out b/libxslt/tests/exslt/math/highest.2.out
new file mode 100644
index 0000000..06ef06f
--- /dev/null
+++ b/libxslt/tests/exslt/math/highest.2.out
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<result>Highest: </result>
diff --git a/libxslt/tests/exslt/math/highest.2.xml b/libxslt/tests/exslt/math/highest.2.xml
new file mode 100644
index 0000000..6f5aaee
--- /dev/null
+++ b/libxslt/tests/exslt/math/highest.2.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<values /> \ No newline at end of file
diff --git a/libxslt/tests/exslt/math/highest.2.xsl b/libxslt/tests/exslt/math/highest.2.xsl
new file mode 100644
index 0000000..eccb186
--- /dev/null
+++ b/libxslt/tests/exslt/math/highest.2.xsl
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<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:template match="values">
+ <result>
+ <xsl:text>Highest: </xsl:text>
+ <xsl:value-of select="math:highest(value)/@id" />
+ </result>
+</xsl:template>
+
+</xsl:stylesheet> \ No newline at end of file
diff --git a/libxslt/tests/exslt/math/highest.5.out b/libxslt/tests/exslt/math/highest.5.out
new file mode 100644
index 0000000..6e6c918
--- /dev/null
+++ b/libxslt/tests/exslt/math/highest.5.out
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<out xmlns:math="http://exslt.org/math">
+ * <lowest-prices>4;
+ 7;
+ </lowest-prices>
+ * <highest-prices>1;
+ 5;
+ </highest-prices></out>
diff --git a/libxslt/tests/exslt/math/highest.5.xml b/libxslt/tests/exslt/math/highest.5.xml
new file mode 100644
index 0000000..3752f75
--- /dev/null
+++ b/libxslt/tests/exslt/math/highest.5.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" ?>
+<sales>
+<sale id="1" qty="10" price="15.00"/>
+<sale id="2" qty="2" price="12.00"/>
+<sale id="3" qty="1" price="10.00"/>
+<sale id="4" qty="2" price="5.00"/>
+<sale id="5" qty="2" price="15.00"/>
+<sale id="6" qty="2" price="8.00"/>
+<sale id="7" qty="2" price="5.00"/>
+</sales>
diff --git a/libxslt/tests/exslt/math/highest.5.xsl b/libxslt/tests/exslt/math/highest.5.xsl
new file mode 100644
index 0000000..c294e76
--- /dev/null
+++ b/libxslt/tests/exslt/math/highest.5.xsl
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template match="/" xmlns:math="http://exslt.org/math">
+ <out>
+ * <lowest-prices>
+ <xsl:for-each select="math:lowest(//sale/@price)">
+ <xsl:value-of select="../@id"/>;
+ </xsl:for-each>
+ </lowest-prices>
+ * <highest-prices>
+ <xsl:for-each select="math:highest(//sale/@price)">
+ <xsl:value-of select="../@id"/>;
+ </xsl:for-each>
+ </highest-prices>
+ </out>
+ </xsl:template>
+</xsl:stylesheet>
+
diff --git a/libxslt/tests/exslt/math/lowest.1.out b/libxslt/tests/exslt/math/lowest.1.out
new file mode 100644
index 0000000..c948f25
--- /dev/null
+++ b/libxslt/tests/exslt/math/lowest.1.out
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<result>Lowest: four</result>
diff --git a/libxslt/tests/exslt/math/lowest.1.xml b/libxslt/tests/exslt/math/lowest.1.xml
new file mode 100644
index 0000000..bb438f3
--- /dev/null
+++ b/libxslt/tests/exslt/math/lowest.1.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<values>
+ <value id="one">7</value>
+ <value id="two">11</value>
+ <value id="three">8</value>
+ <value id="four">4</value>
+</values> \ No newline at end of file
diff --git a/libxslt/tests/exslt/math/lowest.1.xsl b/libxslt/tests/exslt/math/lowest.1.xsl
new file mode 100644
index 0000000..70bec0a
--- /dev/null
+++ b/libxslt/tests/exslt/math/lowest.1.xsl
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<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:template match="values">
+ <result>
+ <xsl:text>Lowest: </xsl:text>
+ <xsl:value-of select="math:lowest(value)/@id" />
+ </result>
+</xsl:template>
+
+</xsl:stylesheet> \ No newline at end of file
diff --git a/libxslt/tests/exslt/math/lowest.2.out b/libxslt/tests/exslt/math/lowest.2.out
new file mode 100644
index 0000000..137056d
--- /dev/null
+++ b/libxslt/tests/exslt/math/lowest.2.out
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<result>Lowest: </result>
diff --git a/libxslt/tests/exslt/math/lowest.2.xml b/libxslt/tests/exslt/math/lowest.2.xml
new file mode 100644
index 0000000..6f5aaee
--- /dev/null
+++ b/libxslt/tests/exslt/math/lowest.2.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<values /> \ No newline at end of file
diff --git a/libxslt/tests/exslt/math/lowest.2.xsl b/libxslt/tests/exslt/math/lowest.2.xsl
new file mode 100644
index 0000000..70bec0a
--- /dev/null
+++ b/libxslt/tests/exslt/math/lowest.2.xsl
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<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:template match="values">
+ <result>
+ <xsl:text>Lowest: </xsl:text>
+ <xsl:value-of select="math:lowest(value)/@id" />
+ </result>
+</xsl:template>
+
+</xsl:stylesheet> \ No newline at end of file
diff --git a/libxslt/tests/exslt/math/max.1.out b/libxslt/tests/exslt/math/max.1.out
new file mode 100644
index 0000000..eef5176
--- /dev/null
+++ b/libxslt/tests/exslt/math/max.1.out
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<result>Maximum: 11</result>
diff --git a/libxslt/tests/exslt/math/max.1.xml b/libxslt/tests/exslt/math/max.1.xml
new file mode 100644
index 0000000..f4229ec
--- /dev/null
+++ b/libxslt/tests/exslt/math/max.1.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<values>
+ <value>7</value>
+ <value>11</value>
+ <value>8</value>
+ <value>4</value>
+</values> \ No newline at end of file
diff --git a/libxslt/tests/exslt/math/max.1.xsl b/libxslt/tests/exslt/math/max.1.xsl
new file mode 100644
index 0000000..82e91b5
--- /dev/null
+++ b/libxslt/tests/exslt/math/max.1.xsl
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<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:template match="values">
+ <result>
+ <xsl:text>Maximum: </xsl:text>
+ <xsl:value-of select="math:max(value)" />
+ </result>
+</xsl:template>
+
+</xsl:stylesheet> \ No newline at end of file
diff --git a/libxslt/tests/exslt/math/max.2.out b/libxslt/tests/exslt/math/max.2.out
new file mode 100644
index 0000000..491a226
--- /dev/null
+++ b/libxslt/tests/exslt/math/max.2.out
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<result>Maximum: NaN</result>
diff --git a/libxslt/tests/exslt/math/max.2.xml b/libxslt/tests/exslt/math/max.2.xml
new file mode 100644
index 0000000..6f5aaee
--- /dev/null
+++ b/libxslt/tests/exslt/math/max.2.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<values /> \ No newline at end of file
diff --git a/libxslt/tests/exslt/math/max.2.xsl b/libxslt/tests/exslt/math/max.2.xsl
new file mode 100644
index 0000000..82e91b5
--- /dev/null
+++ b/libxslt/tests/exslt/math/max.2.xsl
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<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:template match="values">
+ <result>
+ <xsl:text>Maximum: </xsl:text>
+ <xsl:value-of select="math:max(value)" />
+ </result>
+</xsl:template>
+
+</xsl:stylesheet> \ No newline at end of file
diff --git a/libxslt/tests/exslt/math/max.3.out b/libxslt/tests/exslt/math/max.3.out
new file mode 100644
index 0000000..d23881c
--- /dev/null
+++ b/libxslt/tests/exslt/math/max.3.out
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
+Largest number value: 500
+Largest number value (computed by function foo:getMaxVal): 500
+Largest number value (computed by function foo:getMaxVal2): 500
diff --git a/libxslt/tests/exslt/math/max.3.xml b/libxslt/tests/exslt/math/max.3.xml
new file mode 100644
index 0000000..79a00e1
--- /dev/null
+++ b/libxslt/tests/exslt/math/max.3.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
+<rootelement>
+ <childelement val="100"/>
+ <childelement val="200"/>
+ <childelement val="500"/>
+ <childelement val="300"/>
+ <childelement val="nothing"/>
+</rootelement>
+
diff --git a/libxslt/tests/exslt/math/max.3.xsl b/libxslt/tests/exslt/math/max.3.xsl
new file mode 100644
index 0000000..b3410f6
--- /dev/null
+++ b/libxslt/tests/exslt/math/max.3.xsl
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
+
+<!DOCTYPE xsl:stylesheet [
+
+<!-- namespace for SVG -->
+<!ENTITY svgns "http://www.w3.org/2000/svg">
+<!-- namespace for XSLT -->
+<!ENTITY xsltns "http://www.w3.org/1999/XSL/Transform">
+
+<!-- namespaces for several EXSLT extension modules (see
+ http://www.exslt.org for description) -->
+<!ENTITY cns "http://exslt.org/common"> <!-- EXSLT-Common -->
+<!ENTITY fns "http://exslt.org/functions"> <!-- EXSLT-Functions -->
+<!ENTITY mns "http://exslt.org/math"> <!-- EXSLT-Math -->
+
+<!ENTITY foons "http://www.foo.org/bar">
+
+]>
+
+<xsl:stylesheet version="1.0"
+ xmlns="&svgns;"
+ xmlns:xsl="&xsltns;"
+ xmlns:exsl="&cns;"
+ xmlns:func="&fns;"
+ xmlns:math="&mns;"
+ xmlns:foo="&foons;"
+ extension-element-prefixes="exsl func math foo"
+ exclude-result-prefixes="xsl exsl func math">
+
+<xsl:output method="xml" indent="yes" encoding="iso-8859-1" standalone="yes"/>
+
+<xsl:template match="/">
+
+ <xsl:text>Largest number value: </xsl:text>
+ <xsl:value-of
+ select="math:max(rootelement/childelement/@val[string(number(.)) != 'NaN'])"/>
+ <xsl:text>
+Largest number value (computed by function foo:getMaxVal): </xsl:text>
+ <xsl:value-of select="foo:getMaxVal(rootelement/childelement)"/>
+ <xsl:text>
+Largest number value (computed by function foo:getMaxVal2): </xsl:text>
+ <xsl:value-of select="foo:getMaxVal2(rootelement/childelement)"/>
+</xsl:template>
+
+<func:function name="foo:getMaxVal">
+ <xsl:param name="nodes"/>
+
+ <xsl:variable name="resNodes">
+ <xsl:for-each select="$nodes">
+ <xsl:if test="@val and string(number(@val)) != 'NaN'">
+ <dummynode>
+ <xsl:value-of select="@val"/>
+ </dummynode>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:variable>
+
+ <xsl:variable name="resNodeSet" select="exsl:node-set($resNodes)"/>
+
+ <func:result select="math:max($resNodeSet/*)"/>
+</func:function>
+
+<func:function name="foo:getMaxVal2">
+ <xsl:param name="nodes"/>
+
+ <xsl:variable name="resNodes">
+ <xsl:for-each select="$nodes">
+ <xsl:if test="@val and string(number(@val)) != 'NaN'">
+ <dummynode>
+ <xsl:value-of select="@val"/>
+ </dummynode>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:variable>
+
+ <func:result select="math:max(exsl:node-set($resNodes)/*)"/>
+</func:function>
+
+</xsl:stylesheet>
+
diff --git a/libxslt/tests/exslt/math/max.5.out b/libxslt/tests/exslt/math/max.5.out
new file mode 100644
index 0000000..f8b0a31
--- /dev/null
+++ b/libxslt/tests/exslt/math/max.5.out
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<out xmlns:math="http://exslt.org/math">
+ Minimum: <minprice>10</minprice>
+ Maximum: <maxprice>15</maxprice></out>
diff --git a/libxslt/tests/exslt/math/max.5.xml b/libxslt/tests/exslt/math/max.5.xml
new file mode 100644
index 0000000..e34f289
--- /dev/null
+++ b/libxslt/tests/exslt/math/max.5.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" ?>
+<sales>
+<sale qty="10" price="15.00"/>
+<sale qty="2" price="12.00"/>
+<sale qty="1" price="10.00"/>
+</sales>
diff --git a/libxslt/tests/exslt/math/max.5.xsl b/libxslt/tests/exslt/math/max.5.xsl
new file mode 100644
index 0000000..547e8c8
--- /dev/null
+++ b/libxslt/tests/exslt/math/max.5.xsl
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:template match="/" xmlns:math="http://exslt.org/math">
+ <out>
+ Minimum: <minprice><xsl:value-of select="math:min(//sale/@price)"/></minprice>
+ Maximum: <maxprice><xsl:value-of select="math:max(//sale/@price)"/></maxprice>
+ </out>
+ </xsl:template>
+</xsl:stylesheet>
+
diff --git a/libxslt/tests/exslt/math/min.1.out b/libxslt/tests/exslt/math/min.1.out
new file mode 100644
index 0000000..7ca4db5
--- /dev/null
+++ b/libxslt/tests/exslt/math/min.1.out
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<result>Minimum: 4</result>
diff --git a/libxslt/tests/exslt/math/min.1.xml b/libxslt/tests/exslt/math/min.1.xml
new file mode 100644
index 0000000..f4229ec
--- /dev/null
+++ b/libxslt/tests/exslt/math/min.1.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<values>
+ <value>7</value>
+ <value>11</value>
+ <value>8</value>
+ <value>4</value>
+</values> \ No newline at end of file
diff --git a/libxslt/tests/exslt/math/min.1.xsl b/libxslt/tests/exslt/math/min.1.xsl
new file mode 100644
index 0000000..ca619cf
--- /dev/null
+++ b/libxslt/tests/exslt/math/min.1.xsl
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<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:template match="values">
+ <result>
+ <xsl:text>Minimum: </xsl:text>
+ <xsl:value-of select="math:min(value)" />
+ </result>
+</xsl:template>
+
+</xsl:stylesheet> \ No newline at end of file
diff --git a/libxslt/tests/exslt/math/min.2.out b/libxslt/tests/exslt/math/min.2.out
new file mode 100644
index 0000000..37b507a
--- /dev/null
+++ b/libxslt/tests/exslt/math/min.2.out
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<result>Minimum: NaN</result>
diff --git a/libxslt/tests/exslt/math/min.2.xml b/libxslt/tests/exslt/math/min.2.xml
new file mode 100644
index 0000000..6f5aaee
--- /dev/null
+++ b/libxslt/tests/exslt/math/min.2.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<values /> \ No newline at end of file
diff --git a/libxslt/tests/exslt/math/min.2.xsl b/libxslt/tests/exslt/math/min.2.xsl
new file mode 100644
index 0000000..ca619cf
--- /dev/null
+++ b/libxslt/tests/exslt/math/min.2.xsl
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<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:template match="values">
+ <result>
+ <xsl:text>Minimum: </xsl:text>
+ <xsl:value-of select="math:min(value)" />
+ </result>
+</xsl:template>
+
+</xsl:stylesheet> \ No newline at end of file
diff --git a/libxslt/tests/exslt/math/power.1.out b/libxslt/tests/exslt/math/power.1.out
new file mode 100644
index 0000000..da9cb6d
--- /dev/null
+++ b/libxslt/tests/exslt/math/power.1.out
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<results>
+ <result>1</result>
+ <result>7</result>
+ <result>2.85311670611e+11</result>
+ <result>256</result>
+ <result>243</result>
+</results>
diff --git a/libxslt/tests/exslt/math/power.1.xml b/libxslt/tests/exslt/math/power.1.xml
new file mode 100644
index 0000000..93e0401
--- /dev/null
+++ b/libxslt/tests/exslt/math/power.1.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<values>
+ <value base="1">7</value>
+ <value base="7">1</value>
+ <value base="11">11</value>
+ <value base="2">8</value>
+ <value base="3">5</value>
+</values>
diff --git a/libxslt/tests/exslt/math/power.1.xsl b/libxslt/tests/exslt/math/power.1.xsl
new file mode 100644
index 0000000..aad0bd7
--- /dev/null
+++ b/libxslt/tests/exslt/math/power.1.xsl
@@ -0,0 +1,19 @@
+<?xml version="1.0"?>
+<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:template match="values">
+ <results>
+ <xsl:apply-templates/>
+ </results>
+</xsl:template>
+
+<xsl:template match="value">
+ <result>
+ <xsl:value-of select="math:power(./@base,.)" />
+ </result>
+</xsl:template>
+
+</xsl:stylesheet>