-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathempty.go
48 lines (45 loc) · 968 Bytes
/
empty.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package docxlib
import "encoding/xml"
func emptyRelationships() []*Relationship {
defaultRel := []*Relationship{
{
ID: "rId1",
Type: `http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles`,
Target: "styles.xml",
},
{
ID: "rId2",
Type: `http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme`,
Target: "theme/theme1.xml",
},
{
ID: "rId3",
Type: `http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable`,
Target: "fontTable.xml",
},
}
return defaultRel
}
func emptyFile() *DocxLib {
docx := &DocxLib{
Document: Document{
XMLName: xml.Name{
Space: "w",
},
XMLW: XMLNS_W,
XMLR: XMLNS_R,
Body: &Body{
XMLName: xml.Name{
Space: "w",
},
Paragraphs: make([]*Paragraph, 0),
},
},
DocRelation: Relationships{
Xmlns: XMLNS,
Relationships: emptyRelationships(),
},
rId: 4,
}
return docx
}