tika-core/src/main/java/org/apache/tika/sax/DIFContentHandler.java [41:147]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public DIFContentHandler(ContentHandler delegate, Metadata metadata) {
        this.delegate = delegate;
        this.isLeaf = false;
        this.metadata = metadata;
        this.treeStack = new Stack<>();
        this.dataStack = new Stack<>();
    }

    @Override
    public void setDocumentLocator(org.xml.sax.Locator locator) {
        delegate.setDocumentLocator(locator);
    }

    @Override
    public void characters(char[] ch, int start, int length) throws SAXException {
        String value = new String(ch, start, length);
        this.dataStack.push(value);

        if (this.treeStack.peek().equals("Entry_Title")) {
            this.delegate.characters(NEWLINE, 0, NEWLINE.length);
            this.delegate.characters(TABSPACE, 0, TABSPACE.length);
            this.delegate.startElement("", "h3", "h3", EMPTY_ATTRIBUTES);
            String title = "Title: ";
            title = title + value;
            this.delegate.characters(title.toCharArray(), 0, title.length());
            this.delegate.endElement("", "h3", "h3");
        }
        if (this.treeStack.peek().equals("Southernmost_Latitude") ||
                this.treeStack.peek().equals("Northernmost_Latitude") ||
                this.treeStack.peek().equals("Westernmost_Longitude") ||
                this.treeStack.peek().equals("Easternmost_Longitude")) {
            this.delegate.characters(NEWLINE, 0, NEWLINE.length);
            this.delegate.characters(TABSPACE, 0, TABSPACE.length);
            this.delegate.characters(TABSPACE, 0, TABSPACE.length);
            this.delegate.startElement("", "tr", "tr", EMPTY_ATTRIBUTES);
            this.delegate.startElement("", "td", "td", EMPTY_ATTRIBUTES);
            String key = this.treeStack.peek() + " : ";
            this.delegate.characters(key.toCharArray(), 0, key.length());
            this.delegate.endElement("", "td", "td");
            this.delegate.startElement("", "td", "td", EMPTY_ATTRIBUTES);
            this.delegate.characters(value.toCharArray(), 0, value.length());
            this.delegate.endElement("", "td", "td");
            this.delegate.endElement("", "tr", "tr");
        }
    }

    @Override
    public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException {
        delegate.ignorableWhitespace(ch, start, length);
    }

    @Override
    public void startElement(String uri, String localName, String qName, Attributes attributes)
            throws SAXException {
        this.isLeaf = true;
        if (localName.equals("Spatial_Coverage")) {
            this.delegate.characters(NEWLINE, 0, NEWLINE.length);
            this.delegate.characters(TABSPACE, 0, TABSPACE.length);
            this.delegate.startElement("", "h3", "h3", EMPTY_ATTRIBUTES);
            String value = "Geographic Data: ";
            this.delegate.characters(value.toCharArray(), 0, value.length());
            this.delegate.endElement("", "h3", "h3");
            this.delegate.characters(NEWLINE, 0, NEWLINE.length);
            this.delegate.characters(TABSPACE, 0, TABSPACE.length);
            this.delegate.startElement("", "table", "table", EMPTY_ATTRIBUTES);
        }
        this.treeStack.push(localName);
    }

    @Override
    public void endElement(String uri, String localName, String qName) throws SAXException {
        if (localName.equals("Spatial_Coverage")) {
            this.delegate.characters(NEWLINE, 0, NEWLINE.length);
            this.delegate.characters(TABSPACE, 0, TABSPACE.length);
            this.delegate.endElement("", "table", "table");
        }
        if (this.isLeaf) {
            Stack<String> tempStack = (Stack<String>) this.treeStack.clone();
            StringBuilder key = new StringBuilder();
            while (!tempStack.isEmpty()) {
                if (key.isEmpty()) {
                    key = new StringBuilder(tempStack.pop());
                } else {
                    key.insert(0, tempStack.pop() + "-");
                }
            }
            String value = this.dataStack.peek();
            this.metadata.add(key.toString(), value);
            this.isLeaf = false;
        }
        this.treeStack.pop();
        this.dataStack.pop();
    }

    @Override
    public void startDocument() throws SAXException {
        delegate.startDocument();
    }

    @Override
    public void endDocument() throws SAXException {
        delegate.endDocument();
    }

    @Override
    public String toString() {
        return delegate.toString();
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-miscoffice-module/src/main/java/org/apache/tika/parser/dif/DIFContentHandler.java [40:146]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public DIFContentHandler(ContentHandler delegate, Metadata metadata) {
        this.delegate = delegate;
        this.isLeaf = false;
        this.metadata = metadata;
        this.treeStack = new Stack<>();
        this.dataStack = new Stack<>();
    }

    @Override
    public void setDocumentLocator(org.xml.sax.Locator locator) {
        delegate.setDocumentLocator(locator);
    }

    @Override
    public void characters(char[] ch, int start, int length) throws SAXException {
        String value = new String(ch, start, length);
        this.dataStack.push(value);

        if (this.treeStack.peek().equals("Entry_Title")) {
            this.delegate.characters(NEWLINE, 0, NEWLINE.length);
            this.delegate.characters(TABSPACE, 0, TABSPACE.length);
            this.delegate.startElement("", "h3", "h3", EMPTY_ATTRIBUTES);
            String title = "Title: ";
            title = title + value;
            this.delegate.characters(title.toCharArray(), 0, title.length());
            this.delegate.endElement("", "h3", "h3");
        }
        if (this.treeStack.peek().equals("Southernmost_Latitude") ||
                this.treeStack.peek().equals("Northernmost_Latitude") ||
                this.treeStack.peek().equals("Westernmost_Longitude") ||
                this.treeStack.peek().equals("Easternmost_Longitude")) {
            this.delegate.characters(NEWLINE, 0, NEWLINE.length);
            this.delegate.characters(TABSPACE, 0, TABSPACE.length);
            this.delegate.characters(TABSPACE, 0, TABSPACE.length);
            this.delegate.startElement("", "tr", "tr", EMPTY_ATTRIBUTES);
            this.delegate.startElement("", "td", "td", EMPTY_ATTRIBUTES);
            String key = this.treeStack.peek() + " : ";
            this.delegate.characters(key.toCharArray(), 0, key.length());
            this.delegate.endElement("", "td", "td");
            this.delegate.startElement("", "td", "td", EMPTY_ATTRIBUTES);
            this.delegate.characters(value.toCharArray(), 0, value.length());
            this.delegate.endElement("", "td", "td");
            this.delegate.endElement("", "tr", "tr");
        }
    }

    @Override
    public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException {
        delegate.ignorableWhitespace(ch, start, length);
    }

    @Override
    public void startElement(String uri, String localName, String qName, Attributes attributes)
            throws SAXException {
        this.isLeaf = true;
        if (localName.equals("Spatial_Coverage")) {
            this.delegate.characters(NEWLINE, 0, NEWLINE.length);
            this.delegate.characters(TABSPACE, 0, TABSPACE.length);
            this.delegate.startElement("", "h3", "h3", EMPTY_ATTRIBUTES);
            String value = "Geographic Data: ";
            this.delegate.characters(value.toCharArray(), 0, value.length());
            this.delegate.endElement("", "h3", "h3");
            this.delegate.characters(NEWLINE, 0, NEWLINE.length);
            this.delegate.characters(TABSPACE, 0, TABSPACE.length);
            this.delegate.startElement("", "table", "table", EMPTY_ATTRIBUTES);
        }
        this.treeStack.push(localName);
    }

    @Override
    public void endElement(String uri, String localName, String qName) throws SAXException {
        if (localName.equals("Spatial_Coverage")) {
            this.delegate.characters(NEWLINE, 0, NEWLINE.length);
            this.delegate.characters(TABSPACE, 0, TABSPACE.length);
            this.delegate.endElement("", "table", "table");
        }
        if (this.isLeaf) {
            Stack<String> tempStack = (Stack<String>) this.treeStack.clone();
            StringBuilder key = new StringBuilder();
            while (!tempStack.isEmpty()) {
                if (key.isEmpty()) {
                    key = new StringBuilder(tempStack.pop());
                } else {
                    key.insert(0, tempStack.pop() + "-");
                }
            }
            String value = this.dataStack.peek();
            this.metadata.add(key.toString(), value);
            this.isLeaf = false;
        }
        this.treeStack.pop();
        this.dataStack.pop();
    }

    @Override
    public void startDocument() throws SAXException {
        delegate.startDocument();
    }

    @Override
    public void endDocument() throws SAXException {
        delegate.endDocument();
    }

    @Override
    public String toString() {
        return delegate.toString();
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



