aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/zwobble/mammoth/docx/DocumentXml.java
blob: 760f0a448dd009bdf209c521c56e575167208037 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package org.zwobble.mammoth.docx;

import org.zwobble.mammoth.documents.Document;
import org.zwobble.mammoth.xml.XmlElement;

public class DocumentXml {
    private final BodyXml bodyReader;

    public DocumentXml(BodyXml bodyReader) {

        this.bodyReader = bodyReader;
    }

    public Document readDocumentXmlElement(XmlElement element) {
        XmlElement body = element.findChild("w:body");
        return new Document(bodyReader.readElements(body.children()));
    }
}