public static float _parseFloat(CharSequence _val) {
    String s = WhiteSpaceProcessor.trim(_val).toString();
    /* Incompatibilities of XML Schema's float "xfloat" and Java's float "jfloat"

        * jfloat.valueOf ignores leading and trailing whitespaces,
          whereas this is not allowed in xfloat.
        * jfloat.valueOf allows "float type suffix" (f, F) to be
          appended after float literal (e.g., 1.52e-2f), whereare
          this is not the case of xfloat.

        gray zone
        ---------
        * jfloat allows ".523". And there is no clear statement that mentions
          this case in xfloat. Although probably this is allowed.
        *
    */

    if (s.equals("NaN")) return Float.NaN;
    if (s.equals("INF")) return Float.POSITIVE_INFINITY;
    if (s.equals("-INF")) return Float.NEGATIVE_INFINITY;

    if (s.length() == 0
        || !isDigitOrPeriodOrSign(s.charAt(0))
        || !isDigitOrPeriodOrSign(s.charAt(s.length() - 1))) throw new NumberFormatException();

    // these screening process is necessary due to the wobble of Float.valueOf method
    return Float.parseFloat(s);
  }
  public static double _parseDouble(CharSequence _val) {
    String val = WhiteSpaceProcessor.trim(_val).toString();

    if (val.equals("NaN")) return Double.NaN;
    if (val.equals("INF")) return Double.POSITIVE_INFINITY;
    if (val.equals("-INF")) return Double.NEGATIVE_INFINITY;

    if (val.length() == 0
        || !isDigitOrPeriodOrSign(val.charAt(0))
        || !isDigitOrPeriodOrSign(val.charAt(val.length() - 1)))
      throw new NumberFormatException(val);

    // these screening process is necessary due to the wobble of Float.valueOf method
    return Double.parseDouble(val);
  }
  public static BigDecimal _parseDecimal(CharSequence content) {
    content = WhiteSpaceProcessor.trim(content);

    return new BigDecimal(content.toString());

    // from purely XML Schema perspective,
    // this implementation has a problem, since
    // in xs:decimal "1.0" and "1" is equal whereas the above
    // code will return different values for those two forms.
    //
    // the code was originally using com.sun.msv.datatype.xsd.NumberType.load,
    // but a profiling showed that the process of normalizing "1.0" into "1"
    // could take non-trivial time.
    //
    // also, from the user's point of view, one might be surprised if
    // 1 (not 1.0) is returned from "1.000"
  }
 public static BigInteger _parseInteger(CharSequence s) {
   return new BigInteger(removeOptionalPlus(WhiteSpaceProcessor.trim(s)).toString());
 }
 public static GregorianCalendar _parseDateTime(CharSequence s) {
   String val = WhiteSpaceProcessor.trim(s).toString();
   return datatypeFactory.newXMLGregorianCalendar(val).toGregorianCalendar();
 }
 public static long _parseLong(CharSequence s) {
   return Long.valueOf(removeOptionalPlus(WhiteSpaceProcessor.trim(s)).toString());
 }