protected void sendInlineEvent(Event event) throws SAXException {
   if (event.type == Event.Type.BEGIN_ELEMENT) {
     super.startElement(event.uri, event.localName, event.qName, event.atts);
   } else if (event.type == Event.Type.END_ELEMENT) {
     super.endElement(event.uri, event.localName, event.qName);
   } else if (event.type == Event.Type.COMMENT) {
     super.comment(event.content.toCharArray(), 0, event.content.length());
   }
 }
  @Override
  public void comment(char[] ch, int start, int length) throws SAXException {
    if (shouldRemoveWhiteSpaces()) {
      String comment = new String(ch, start, length);

      appendInlineEvent(new Event(comment));
    } else {
      super.comment(ch, start, length);
    }
  }