private static CharClass makeNameCharClass(byte mask) {
List ranges = new ArrayList();
// Add colon to the set of characters matched
ranges.add(new SingleChar(':'));
// Plus all the characters from the NCName tables
IntRangeSet members = XMLCharacterData.getCategory(mask);
int used = members.getNumberOfRanges();
int[] startPoints = members.getStartPoints();
int[] endPoints = members.getEndPoints();
for (int i=0; i<used; i++) {
if (startPoints[i] == endPoints[i] && i <= 65535) {
ranges.add(new SingleChar((char)startPoints[i]));
} else {
ranges.add(new CharRange(startPoints[i], endPoints[i]));