tests/expr/math/math-3306a.xsl
author Michael Kay <mike@saxonica.com>
Mon, 11 Jan 2016 11:27:29 +0000
changeset 1198 aacf3d6d8681
child 1211 226a4c4600fb
permissions -rw-r--r--
Variants of some math tests to force runtime evaluation
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
  xmlns:xs="http://www.w3.org/2001/XMLSchema">
<?spec fo#casting-to-numerics?>
<!-- PURPOSE:  Test that casting to integer truncates towards zero. -->
  <!-- Variant forcing run-time evaluation -->
  
  <xsl:param name="p" select="1"/>
<xsl:template match="doc">
<out>;
<decimal a="{xs:integer($p*3.8)}" b="{xs:integer($p*-3.8)}"/>
<double a="{xs:integer($p*3.8e0)}" b="{xs:integer($p*-3.8e0)}"/>
<float a="{xs:integer($p*xs:float(3.8e0))}" b="{xs:integer($p*xs:float(-3.8e0))}"/>
</out>
</xsl:template>
</xsl:stylesheet>