Divides $decimal-var1 by $decimal-var2. The div operator invokes the decimal-divide operator.
If the value of $decimal-var2 is equal to zero, the TransformException exception is raised with the RT_DIV_ZERO fault code. The following error message is displayed in the mapper:
Error occurred while executing XQuery: division by zero
op:decimal-divide(xs:decimal $decimal-var1, xs:decimal $decimal-var2) —> xs:decimal
Returns the decimal value of dividing $decimal-var1 by $decimal-var2.
Invoking decimal-divide("2.2","1.1") returns the decimal value 2 as shown in the following example query:
<decimal-divide>{op:decimal-divide("2.2","1.1")}</decimal-divide>
The preceding query generates the following result:
<decimal-divide>2.0</decimal-divide>
Invoking decimal-divide("2.2","0")throws the TransformException exception with the RT_DIV_ZERO fault code as shown in the following example query:
<decimal-divide>{op:decimal-divide("2.2","0")}</decimal-divide>
The following error message is displayed in the mapper:
Error occurred while executing XQuery: division by zero
W3C decimal data type description.
W3C numeric-divide operator description.