MCPcopy Index your code
hub / github.com/TruthHun/BookStack / readXmlFileWithBody

Function readXmlFileWithBody

static/word2md/mammoth.browser.js:1692–1713  ·  view source on GitHub ↗
(filename, options, func)

Source from the content-addressed store, hash-verified

1690}
1691
1692function readXmlFileWithBody(filename, options, func) {
1693 var readRelationshipsFromZipFile = xmlFileReader({
1694 filename: relationshipsFilename(filename),
1695 readElement: relationshipsReader.readRelationships,
1696 defaultValue: relationshipsReader.defaultValue
1697 });
1698
1699 return readRelationshipsFromZipFile(options.docxFile).then(function(relationships) {
1700 var bodyReader = new createBodyReader({
1701 relationships: relationships,
1702 contentTypes: options.contentTypes,
1703 docxFile: options.docxFile,
1704 numbering: options.numbering,
1705 styles: options.styles,
1706 files: options.files
1707 });
1708 return readXmlFromZipFile(options.docxFile, filename)
1709 .then(function(xml) {
1710 return func(bodyReader, xml);
1711 });
1712 });
1713}
1714
1715function relationshipsFilename(filename) {
1716 var split = zipfile.splitPath(filename);

Callers 1

readFunction · 0.70

Calls 4

funcFunction · 0.85
xmlFileReaderFunction · 0.70
relationshipsFilenameFunction · 0.70
readXmlFromZipFileFunction · 0.70

Tested by

no test coverage detected