summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2024-02-18 11:29:39 +0000
committerMichael Williamson <mike@zwobble.org>2024-02-18 11:29:39 +0000
commitc884adf1d81537c7d7da63ace5627f3a3d615f1e (patch)
tree47eea5db7c64ceb43aceb0bb81780a9c9e6cbdc2
parent149bf2b104811fca267c1e9c1845dd61f4adfcc9 (diff)
Add support for the strict document format
-rw-r--r--NEWS2
-rw-r--r--lib/docx/office-xml-reader.js13
2 files changed, 14 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 25a0fb1..1567786 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,8 @@
* Improve error message when failing to find the body element in a document.
+* Add support for the strict document format.
+
# 1.6.0
* Add transformDocument to the TypeScript declarations.
diff --git a/lib/docx/office-xml-reader.js b/lib/docx/office-xml-reader.js
index a8d4c47..df7f99a 100644
--- a/lib/docx/office-xml-reader.js
+++ b/lib/docx/office-xml-reader.js
@@ -8,15 +8,26 @@ exports.read = read;
exports.readXmlFromZipFile = readXmlFromZipFile;
var xmlNamespaceMap = {
+ // Transitional mode
"http://schemas.openxmlformats.org/wordprocessingml/2006/main": "w",
"http://schemas.openxmlformats.org/officeDocument/2006/relationships": "r",
"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing": "wp",
"http://schemas.openxmlformats.org/drawingml/2006/main": "a",
"http://schemas.openxmlformats.org/drawingml/2006/picture": "pic",
+
+ // Strict mode
+ "http://purl.oclc.org/ooxml/wordprocessingml/main": "w",
+ "http://purl.oclc.org/ooxml/officeDocument/relationships": "r",
+ "http://purl.oclc.org/ooxml/drawingml/wordprocessingDrawing": "wp",
+ "http://purl.oclc.org/ooxml/drawingml/main": "a",
+ "http://purl.oclc.org/ooxml/drawingml/picture": "pic",
+
+ // Common
"http://schemas.openxmlformats.org/package/2006/content-types": "content-types",
- "urn:schemas-microsoft-com:vml": "v",
"http://schemas.openxmlformats.org/markup-compatibility/2006": "mc",
+ "urn:schemas-microsoft-com:vml": "v",
"urn:schemas-microsoft-com:office:word": "office-word"
+
};