Skip to content

Commit

Permalink
Add support for the strict document format
Browse files Browse the repository at this point in the history
  • Loading branch information
mwilliamson committed Feb 18, 2024
1 parent 149bf2b commit c884adf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
13 changes: 12 additions & 1 deletion lib/docx/office-xml-reader.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"

};


Expand Down

0 comments on commit c884adf

Please sign in to comment.