Checks if the specified token is a valid name. @param value value to be checked @return result of check
(final byte[] value)
| 196 | * @return result of check |
| 197 | */ |
| 198 | public static boolean isName(final byte[] value) { |
| 199 | final int vl = value.length; |
| 200 | for(int v = 0; v < vl; v += cl(value, v)) { |
| 201 | final int cp = cp(value, v); |
| 202 | if(v == 0 ? !isStartChar(cp) : !isChar(cp)) return false; |
| 203 | } |
| 204 | return vl != 0; |
| 205 | } |
| 206 | |
| 207 | /** |
| 208 | * Checks if the specified token is a valid NMToken. |