@Override
    public void checkValid(CharSequence literal)
            throws DatatypeException {
        int len = literal.length();
        if (len == 0) {
            throw newDatatypeException("An ID must not be the empty string.");
        }
        for (int i = 0; i < len; i++) {
            char c = literal.charAt(i);
            if (isWhitespace(c)) {
                throw newDatatypeException(i, "An ID must not contain whitespace.");
            }
        }
    }
Checks that the value is a proper HTML5 id.
@param literal the value
@throws DatatypeException if the value isn't valid
@see org.relaxng.datatype.Datatype#checkValid(java.lang.String, org.relaxng.datatype.ValidationContext)
src/nu/validator/datatype/Id.java