MCPcopy
hub / github.com/qax-os/excelize / namespaceStrictToTransitional

Function namespaceStrictToTransitional

lib.go:575–592  ·  view source on GitHub ↗

namespaceStrictToTransitional provides a method to convert Strict and Transitional namespaces.

(content []byte)

Source from the content-addressed store, hash-verified

573// namespaceStrictToTransitional provides a method to convert Strict and
574// Transitional namespaces.
575func 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.
595func bytesReplace(s, source, target []byte, n int) []byte {

Callers 15

calcChainReaderMethod · 0.85
volatileDepsReaderMethod · 0.85
workbookReaderMethod · 0.85
slicerReaderMethod · 0.85
slicerCacheReaderMethod · 0.85
timelineReaderMethod · 0.85
adjustTableMethod · 0.85
contentTypesReaderMethod · 0.85
relsReaderMethod · 0.85
AddTableMethod · 0.85
GetTablesMethod · 0.85
countTablesMethod · 0.85

Calls 1

bytesReplaceFunction · 0.85

Tested by

no test coverage detected