private void chooseDeclPatterns() {
    if (options.elementDeclPattern != null) {
      if (patternOk(options.elementDeclPattern, null))
        elementDeclPattern = options.elementDeclPattern;
      else
        warning("cannot_use_element_decl_pattern");
    }
    if (options.attlistDeclPattern != null) {
      if (patternOk(options.attlistDeclPattern, elementDeclPattern))
        attlistDeclPattern = options.attlistDeclPattern;
      else
        warning("cannot_use_attlist_decl_pattern");
    }
    if (elementDeclPattern != null && attlistDeclPattern != null)
      return;
    // XXX Try to match length and case of best prefix
    String pattern = namingPattern();
    if (elementDeclPattern == null) {
      if (patternOk("%", attlistDeclPattern))
        elementDeclPattern = "%";
      else
        elementDeclPattern = choosePattern(pattern, ELEMENT_KEYWORDS, attlistDeclPattern);
    }
    if (attlistDeclPattern == null)
      attlistDeclPattern = choosePattern(pattern, ATTLIST_KEYWORDS, elementDeclPattern);
  }