(docxFile)
| 1975 | } |
| 1976 | |
| 1977 | function updateRelationships(docxFile) { |
| 1978 | var path = "word/_rels/document.xml.rels"; |
| 1979 | var relationshipsUri = "http://schemas.openxmlformats.org/package/2006/relationships"; |
| 1980 | var relationshipElementName = "{" + relationshipsUri + "}Relationship"; |
| 1981 | return docxFile.read(path, "utf8") |
| 1982 | .then(xml.readString) |
| 1983 | .then(function(relationshipsContainer) { |
| 1984 | var relationships = relationshipsContainer.children; |
| 1985 | addOrUpdateElement(relationships, relationshipElementName, "Id", { |
| 1986 | "Id": "rMammothStyleMap", |
| 1987 | "Type": schema, |
| 1988 | "Target": styleMapAbsolutePath |
| 1989 | }); |
| 1990 | |
| 1991 | var namespaces = {"": relationshipsUri}; |
| 1992 | return docxFile.write(path, xml.writeString(relationshipsContainer, namespaces)); |
| 1993 | }); |
| 1994 | } |
| 1995 | |
| 1996 | function updateContentTypes(docxFile) { |
| 1997 | var path = "[Content_Types].xml"; |
no test coverage detected