code: @Override
      public String validate(DTDValidatorBase v, char[] cbuf, int start, int end, boolean normalize)
          throws XMLStreamException
      {
          int origLen = end-start;
  
          // Let's trim leading white space first...
          while (start < end && WstxInputData.isSpaceChar(cbuf[start])) {
              ++start;
          }
  
          // Empty value?
          if (start >= end) {
              return reportValidationProblem(v, "Empty NMTOKEN value");
          }
  
          --end; // so that it now points to the last char
          while (end > start && WstxInputData.isSpaceChar(cbuf[end])) {
              --end;
          }
  
          // Ok, need to check char validity
          for (int i = start; i <= end; ++i) {
              char c = cbuf[i];
              if (!WstxInputData.isNameChar(c, mCfgNsAware, mCfgXml11)) {
                  return reportInvalidChar(v, c, "not valid NMTOKEN character");
              }
          }
  
          if (normalize) {
              // Let's only create the String if we trimmed something
              int len = (end - start)+1;
              if (len != origLen) {
                  return new String(cbuf, start, len);
              }
          }
          return null;
      }
docs: Method called by the validator
  to let the attribute do necessary normalization and/or validation
  for the value.