Exemple #1
0
  public void endElement(String namespaceURI, String localName, String qName) throws SAXException {
    try {
      charsAdded = false;
      --indentLevel;

      if (lastElementClosed) {
        writePrintln();
        indent();
      }

      // XXXX: need to determine this using a stack and checking for
      // content / children
      boolean hadContent = true;

      if (hadContent) {
        writeClose(qName);
      } else {
        writeEmptyElementClose(qName);
      }

      lastOutputNodeType = Node.ELEMENT_NODE;
      lastElementClosed = true;

      super.endElement(namespaceURI, localName, qName);
    } catch (IOException e) {
      handleException(e);
    }
  }
Exemple #2
0
 /**
  * Writes the closing tag of an {@link Element}
  *
  * @param element <code>Element</code> to output.
  * @throws IOException DOCUMENT ME!
  */
 public void writeClose(Element element) throws IOException {
   writeClose(element.getQualifiedName());
 }