code: @Override
      public void endElement(String uri, String localName, String qName) throws SAXException {
          // currentElement represents the last string encountered in the document
          setCurrentElement(getElementNames().pop());
  
          if (getCurrentElement().equalsIgnoreCase(GPXTags.WPT)) {
              //if </wpt> markup is found, the currentPoint is added in the table wptdbd and the default contentHandler is setted.
              try {
                  PreparedStatement pStm = getWptPreparedStmt();
                  int i = 1;
                  Object[] values = getCurrentPoint().getValues();
                  for (Object object : values) {
                      pStm.setObject(i, object);
                      i++;
                  }
                  pStm.execute();
              } catch (SQLException ex) {
                  throw new SAXException("Cannot import the waypoint.", ex);
              }
              getReader().setContentHandler(parent);
  
          } else {
              getCurrentPoint().setAttribute(getCurrentElement(), getContentBuffer());
          }
      }
docs: Fires whenever an XML end markup is encountered. It catches attributes of
  the waypoint and saves them in corresponding values[].
  
  @param uri URI of the local element
  @param localName Name of the local element (without prefix)
  @param qName qName of the local element (with prefix)
  @throws SAXException Any SAX exception, possibly wrapping another
  exception