@Override
 public void beginRecord(String format, String type) {
   if (recordOpen) {
     return;
   }
   try {
     AttributesImpl attrs = new AttributesImpl();
     if (format != null && !"MARC21".equalsIgnoreCase(schema)) {
       attrs.addAttribute(nsUri, FORMAT, FORMAT, "CDATA", format);
     }
     if (type != null) {
       attrs.addAttribute(nsUri, TYPE, TYPE, "CDATA", type);
     }
     if (contentHandler != null) {
       contentHandler.startElement(nsUri, RECORD, RECORD, attrs);
     }
     if (listener != null) {
       listener.beginRecord(format, type);
     }
     this.recordOpen = true;
   } catch (Exception ex) {
     if (fatalerrors) {
       throw new RuntimeException(ex);
     } else if (!silenterrors) {
       logger.warn(designator + ": " + ex.getMessage(), ex);
     }
   }
 }