namespaceStrictToTransitional provides a method to convert Strict and Transitional namespaces.
(content []byte)
| 573 | // namespaceStrictToTransitional provides a method to convert Strict and |
| 574 | // Transitional namespaces. |
| 575 | func namespaceStrictToTransitional(content []byte) []byte { |
| 576 | namespaceTranslationDic := map[string]string{ |
| 577 | StrictNameSpaceDocumentPropertiesVariantTypes: NameSpaceDocumentPropertiesVariantTypes.Value, |
| 578 | StrictNameSpaceDrawingMLMain: NameSpaceDrawingMLMain, |
| 579 | StrictNameSpaceExtendedProperties: NameSpaceExtendedProperties, |
| 580 | StrictNameSpaceSpreadSheet: NameSpaceSpreadSheet.Value, |
| 581 | StrictSourceRelationship: SourceRelationship.Value, |
| 582 | StrictSourceRelationshipChart: SourceRelationshipChart, |
| 583 | StrictSourceRelationshipComments: SourceRelationshipComments, |
| 584 | StrictSourceRelationshipExtendProperties: SourceRelationshipExtendProperties, |
| 585 | StrictSourceRelationshipImage: SourceRelationshipImage, |
| 586 | StrictSourceRelationshipOfficeDocument: SourceRelationshipOfficeDocument, |
| 587 | } |
| 588 | for s, n := range namespaceTranslationDic { |
| 589 | content = bytesReplace(content, []byte(s), []byte(n), -1) |
| 590 | } |
| 591 | return content |
| 592 | } |
| 593 | |
| 594 | // bytesReplace replace source bytes with given target. |
| 595 | func bytesReplace(s, source, target []byte, n int) []byte { |
no test coverage detected