else if (XMLDatatypeUtil.isNumericDatatype(datatype)) {
// FIXME: decimals, floats and doubles must be processed
// separately, see
// http://www.w3.org/TR/xpath-functions/#casting-from-primitive-to-primitive
try {
BigInteger integerValue = literal.integerValue();
return valueFactory.createLiteral(integerValue.toString(), XMLSchema.INTEGER);
}
catch (NumberFormatException e) {
throw new ValueExprEvaluationException(e.getMessage(), e);
}