From 1c45425f12f38012b975c36f4d17bd1cec3c0aba Mon Sep 17 00:00:00 2001 From: xuri Date: Wed, 17 Oct 2018 00:28:31 +0800 Subject: resolve #276, add OfficeOpenXML-XMLSchema-Strict mode support --- lib.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'lib.go') diff --git a/lib.go b/lib.go index 865ee29..8e63da9 100644 --- a/lib.go +++ b/lib.go @@ -183,3 +183,19 @@ func parseFormatSet(formatSet string) []byte { } return []byte("{}") } + +// namespaceStrictToTransitional provides a method to convert Strict and +// Transitional namespaces. +func namespaceStrictToTransitional(content []byte) []byte { + var namespaceTranslationDic = map[string]string{ + StrictSourceRelationship: SourceRelationship, + StrictSourceRelationshipChart: SourceRelationshipChart, + StrictSourceRelationshipComments: SourceRelationshipComments, + StrictSourceRelationshipImage: SourceRelationshipImage, + StrictNameSpaceSpreadSheet: NameSpaceSpreadSheet, + } + for s, n := range namespaceTranslationDic { + content = bytes.Replace(content, []byte(s), []byte(n), -1) + } + return content +} -- cgit v1.2.1