@Override
 public void endDataField(Field designator) {
   try {
     if (!datafieldOpen) {
       return;
     }
     if (listener != null) {
       listener.endDataField(designator);
     }
     if (designator != null) {
       String value = designator.data();
       if (value != null && !value.isEmpty()) {
         value = normalizeValue(value);
         // write data field per default into a subfield with code 'a'
         AttributesImpl attrs = new AttributesImpl();
         attrs.addAttribute(nsUri, CODE, CODE, "CDATA", "a");
         if (contentHandler != null) {
           contentHandler.startElement(nsUri, SUBFIELD, SUBFIELD, attrs);
           contentHandler.characters(value.toCharArray(), 0, value.length());
           contentHandler.endElement(nsUri, SUBFIELD, SUBFIELD);
         }
       }
     }
     if (contentHandler != null) {
       contentHandler.endElement(NS_URI, DATAFIELD, DATAFIELD);
     }
     datafieldOpen = false;
   } catch (Exception ex) {
     if (fatalerrors) {
       throw new RuntimeException(ex);
     } else if (!silenterrors) {
       logger.warn(designator + ": " + ex.getMessage(), ex);
     }
   }
 }