summaryrefslogtreecommitdiff
path: root/xmlSharedStrings.go
diff options
context:
space:
mode:
Diffstat (limited to 'xmlSharedStrings.go')
-rw-r--r--xmlSharedStrings.go16
1 files changed, 15 insertions, 1 deletions
diff --git a/xmlSharedStrings.go b/xmlSharedStrings.go
index 3fcf3d5..48d4464 100644
--- a/xmlSharedStrings.go
+++ b/xmlSharedStrings.go
@@ -9,7 +9,10 @@
package excelize
-import "encoding/xml"
+import (
+ "encoding/xml"
+ "strings"
+)
// xlsxSST directly maps the sst element from the namespace
// http://schemas.openxmlformats.org/spreadsheetml/2006/main. String values may
@@ -33,6 +36,17 @@ type xlsxSI struct {
R []xlsxR `xml:"r"`
}
+func (x xlsxSI) String() string {
+ if len(x.R) > 0 {
+ var rows strings.Builder
+ for _, s := range x.R {
+ rows.WriteString(s.T)
+ }
+ return rows.String()
+ }
+ return x.T
+}
+
// xlsxR directly maps the r element from the namespace
// http://schemas.openxmlformats.org/spreadsheetml/2006/main - currently I have
// not checked this for completeness - it does as much as I need.