You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
742 B
26 lines
742 B
exports.DocumentXmlReader = DocumentXmlReader;
|
|
|
|
var documents = require("../documents");
|
|
var Result = require("../results").Result;
|
|
|
|
|
|
function DocumentXmlReader(options) {
|
|
var bodyReader = options.bodyReader;
|
|
|
|
function convertXmlToDocument(element) {
|
|
var body = element.first("w:body");
|
|
|
|
var result = bodyReader.readXmlElements(body.children)
|
|
.map(function(children) {
|
|
return new documents.Document(children, {
|
|
notes: options.notes,
|
|
comments: options.comments
|
|
});
|
|
});
|
|
return new Result(result.value, result.messages);
|
|
}
|
|
|
|
return {
|
|
convertXmlToDocument: convertXmlToDocument
|
|
};
|
|
}
|
|
|