docs: private ExternalIdentifiers readExternalIds(boolean inNotation,
              boolean isSubset) throws Exception {
          char c;
          ExternalIdentifiers ids = new ExternalIdentifiers();
          int flags = LIT_DISABLE_CREF | LIT_DISABLE_PE | LIT_DISABLE_EREF;
  
          if (tryRead("PUBLIC")) {
              requireWhitespace();
              ids.publicId = readLiteral(LIT_NORMALIZE | LIT_PUBID | flags);
              if (inNotation) {
                  skipWhitespace();
                  c = readCh();
                  unread(c);
                  if ((c == '"') || (c == '\'')) {
                      ids.systemId = readLiteral(flags);
                  }
              } else {
                  requireWhitespace();
                  ids.systemId = readLiteral(flags);
              }
  
              for (int i = 0; i < ids.publicId.length(); i++) {
                  c = ids.publicId.charAt(i);
                  if ((c >= 'a') && (c <= 'z')) {
                      continue;
                  }
                  if ((c >= 'A') && (c <= 'Z')) {
                      continue;
                  }
                  if (" \r\n0123456789-' ()+,./:=?;!*#@$_%".indexOf(c) != -1) {
                      continue;
                  }
                  fatal("illegal PUBLIC id character U+" + Integer.toHexString(c));
              }
          } else if (tryRead("SYSTEM")) {
              requireWhitespace();
              ids.systemId = readLiteral(flags);
          } else if (!isSubset) {
              fatal("missing SYSTEM or PUBLIC keyword");
          }
  
          if (ids.systemId != null) {
              if (ids.systemId.indexOf('#') != -1) {
                  handler.verror("SYSTEM id has a URI fragment: " + ids.systemId);
              }
              ids.baseUri = handler.getSystemId();
              if ((ids.baseUri == null) && uriWarnings) {
                  handler.warn("No base URI; hope URI is absolute: "
                          + ids.systemId);
              }
          }
  
          return ids;
      }