nmtokenBuf.setLength(0); char c = readCh(); if (isName) { if (!isNameStartCharacter(c)) error("not a name start character", "U+" + Integer.toHexString(c)); } else { if (!isNameCharacter(c)) error("not a name character", "U+" + Integer.toHexString(c)); } nmtokenBuf.append(c); do { mark(1); c = readCh(); switch (c) { case '%': case '<': case '>': case '&': case ',': case '|': case '*': case '+': case '?': case ')': case '=': case '\'': case '"': case '[': case ' ': case '\t': case '\n': case '\r': case ';': case '/': reset(); return intern(nmtokenBuf.toString()); default: if (!isNameCharacter(c)) error("not a name character", "U+" + Integer.toHexString(c)); else nmtokenBuf.append(c); } } while (true);
return readNmtoken(isName, nmtokenBuf);
  private String readNmtoken(boolean isName)    throws IOException, XMLStreamException  {    nmtokenBuf.setLength(0);    char c = readCh();    if (isName)      {        if (!isNameStartCharacter(c))          error("not a name start character",                "U+" + Integer.toHexString(c));      }    else      {        if (!isNameCharacter(c))          error("not a name character",                "U+" + Integer.toHexString(c));      }    nmtokenBuf.append(c);    do      {        mark(1);        c = readCh();        switch (c)          {          case '%':          case '<':          case '>':          case '&':          case ',':          case '|':          case '*':          case '+':          case '?':          case ')':          case '=':          case '\'':          case '"':          case '[':          case ' ':          case '\t':          case '\n':          case '\r':          case ';':          case '/':            reset();            return intern(nmtokenBuf.toString());          default:            if (!isNameCharacter(c))              error("not a name character",                    "U+" + Integer.toHexString(c));            else              nmtokenBuf.append(c);          }      }    while (true);  }